Increase Jenkins Login Timeout

Does anyone know how to increase the timeout window before Jenkins logs out? I am looking to raise it to 1 day or so.

I work in and out of jenkins all day and we continue to exit work mode. Added to this frustration is the "stay logged in" checkbox.

+44
hudson jenkins
16 Oct '14 at 2:56
source share
4 answers

Jenkins uses Jetty and the default timeout for Jetty is 30 minutes . It does not depend on the authentication settings - I use Active Directory, but still this option affects timeouts.

You can override the timeout by passing the argument --sessionTimeout=<minutes> to the Jenkins init script or -DsessionTimeout=<minutes> to the .war file. For example:

 # Set the session timeout to 1 week $ java -jar jenkins.war --sessionTimeout=10080 

Alternatively, you can edit Jenkins <jenkinsHome>/.jenkins/war/WEB-INF/web.xml and add it explicitly:

 <session-config> <!-- one hour --> <session-timeout>60</session-timeout> </session-config> 

According to Oracle docs, you can set this value to 0 to completely disable timeouts.

To find out the current timeout value, you can use the Groovy console provided in Jenkins:

 import org.kohsuke.stapler.Stapler; Stapler.getCurrentRequest().getSession().getMaxInactiveInterval() / 60 

In my instance, this shows Result: 30 .

+38
Aug 04 '15 at 12:57
source share

Starting with 1.528, you can use the --sessionTimeout <minutes> parameter when running jenkins through an init script. If you start a war, go to -DsessionTimeout=<minutes>

Update for 1.6

If --sessionTimeout=<minutes> used as an argument as an argument

+9
Dec 31 '15 at 15:16
source share

It is also possible to install it using the grovy console:

 import org.kohsuke.stapler.Stapler; Stapler.getCurrentRequest().getSession().setMaxInactiveInterval(TIME_IN_SECONDS) 

But I assume that it will be available only for the current session.

+2
Sep 30 '16 at 11:14
source share

This version of Jenkins 1.567 also has an auto-update option, so it somehow updates the session and I never log out. This works for me ...

+1
Oct. 17 '14 at 13:29
source share



All Articles