You want to customize the Jenkins login session timeout, to increase or decrease the length of time before a logged-in user is automatically logged out.
In current versions of Jenkins (since 2.117) there are two command line arguments that control the login session timeout. Both of these may need to be set, depending on your desired outcome:
sessionTimeoutis set in minutes; a user will be logged out after this time, no matter what. Default is 30 minutes.
sessionEvictionis set in seconds; a user will be logged out after this time if their session is idle. Default is 30 minutes.
Prior to version 2.117 there was only the
These arguments need to be passed to the Jenkins war file, NOT to the JVM. This article explains where the arguments should be added, depending on the OS/distribution you are using.
As an example, if you wanted to set the timeout for idle sessions to 1 hour and active sessions to 2 hours, you would use: