You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[JENKINS-9258] "Remember me" doesn't work with Active Directory plugin #15727
When clicking the "Remember me on this computer" during login, after some time the user is logged out.
I'm using Active Directory as Security Realm.
Example protocol:
I logged in at 09:19 and checked the "Remember me on this computer" checkbox.
At 10:10 I freshly opened the jenkins front page again and I was logged it.
At 11:38 again, and I found myself logged out.
All tests were conducted with Firefox 4, accepting cookies and such.
This is reproducible on an installation via Debian package. At the time of writing the version number is 1.405
environment
Debian Squeeze on Linux qa01 2.6.26-2-vserver-amd64 #1 SMP Tue Jan 25 06:09:17 UTC 2011 x86_64 GNU/Linux<br/>
Mac OS X 10.7.3 x86_64<br/>
FC13, Tomcat 6, Jenkins 1.480.2
Are you running several Hudson instances on the same server, but on different ports (e.g. myserver:8080, myserver:8081, myserver:8082)?
The browser cookies that are used to track your successful login unfortunately only store the server name of the URL (e.g. myserver), but not the port (e.g. 8080, 8081, 8082). Thus, if you log into the Hudson instance of server myserver:8080 and then into myserver:8081, the browser cookie for 'myserver' will now track your session on myserver:8081. This essentially logs you out of myserver:8080.
Are you running several Hudson instances on the same server, but on different ports (e.g. myserver:8080, myserver:8081, myserver:8082)?
The browser cookies that are used to track your successful login unfortunately only store the server name of the URL (e.g. myserver), but not the port (e.g. 8080, 8081, 8082). Thus, if you log into the Hudson instance of server myserver:8080 and then into myserver:8081, the browser cookie for 'myserver' will now track your session on myserver:8081. This essentially logs you out of myserver:8080.
In my case, no, I'm only running on instance at one port on a given hostname.
More specific, I'm running the Debian package on port 8081 but accessing it via apache on port 80 with mod_proxy, my virtualhost looks like this:
<VirtualHost *:80>
ServerName jenkins.qa01
ServerAlias jenkins.qa01
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost on
ProxyPass / http://localhost:8081/ retry=1
</VirtualHost>
In my case, no, I'm only running on instance at one port on a given hostname.
More specific, I'm running the Debian package on port 8081 but accessing it via apache on port 80 with mod_proxy, my virtualhost looks like this:
<VirtualHost *:80>
ServerName jenkins.qa01
ServerAlias jenkins.qa01
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost on
ProxyPass / http://localhost:8081/ retry=1
</VirtualHost>
We see this a lot at our company, too. We are using Jenkins 1.458 and use the Active Directory plugin for authentication.
We have seen it with clients on various OS / browsers.
I, too, looked at the cookies on my machine with firecookie, and the "Expires" value for ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE seems valid (it expires a couple weeks from now).
We run Jenkins on port 8080, but forward port 80 to 8080 using iptables, but no client uses 8080 (that I know of).
We see this a lot at our company, too. We are using Jenkins 1.458 and use the Active Directory plugin for authentication.
We have seen it with clients on various OS / browsers.
I, too, looked at the cookies on my machine with firecookie, and the "Expires" value for ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE seems valid (it expires a couple weeks from now).
We run Jenkins on port 8080, but forward port 80 to 8080 using iptables, but no client uses 8080 (that I know of).
We run our instance as a simple setup on a ubuntu 10.04 machine. Runs on port 8080 but forwarded from port 80. There is only one url that we use including the port (default, since we use 80 in practice).
Apparently the trick would be to update web.xml to include this right after the description (or later):
This would tell WinStone (or Tomcat) to have a session expiration of 24h (24*60=1440). The problem is that it would require to extract jenkins.war, patch web.xml and re-zip jenkins.war. Not very automated to get the autoupdates.
ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE is set when 'Remember Me' is checked, it seems valid and expire after 2 weeks.
We run our instance as a simple setup on a ubuntu 10.04 machine. Runs on port 8080 but forwarded from port 80. There is only one url that we use including the port (default, since we use 80 in practice).
Apparently the trick would be to update web.xml to include this right after the description (or later):
This would tell WinStone (or Tomcat) to have a session expiration of 24h (24*60=1440). The problem is that it would require to extract jenkins.war, patch web.xml and re-zip jenkins.war. Not very automated to get the autoupdates.
ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE is set when 'Remember Me' is checked, it seems valid and expire after 2 weeks.
Same here too, Jenkins runs on Debian Linux - we always update to the latest version from the jenkins-repository.
Jenkins is accessed via https on port 8443 (using the JENKINS_ARGS to supply the httpsPort argument, keystore et cetera) and use active directory for authentication.
If there's any more information I can supply that'd help in analyzing the problem please let me know.
Same here too, Jenkins runs on Debian Linux - we always update to the latest version from the jenkins-repository.
Jenkins is accessed via https on port 8443 (using the JENKINS_ARGS to supply the httpsPort argument, keystore et cetera) and use active directory for authentication.
If there's any more information I can supply that'd help in analyzing the problem please let me know.
This is the most annoying thing about Jenkins at our company.
I have a pull request that incorporates Stephane Odul's session timeout suggestion (with a default of two days). Please comment on the pull request if you'd like to see it approved. The more comments, the more popular, the better chance it has to make it in to the main line. Thanks!
This is the most annoying thing about Jenkins at our company.
I have a pull request that incorporates Stephane Odul's session timeout suggestion (with a default of two days). Please comment on the pull request if you'd like to see it approved. The more comments, the more popular, the better chance it has to make it in to the main line. Thanks!
Stephane Odul's solution is just a hack though. The problem is not that the session expires, it's that the remember me feature does not do anything to make you a new one.
I agree though that it is the most annoying thing about Jenkins and really needs proper dev attention ASAP.
Stephane Odul's solution is just a hack though. The problem is not that the session expires, it's that the remember me feature does not do anything to make you a new one.
I agree though that it is the most annoying thing about Jenkins and really needs proper dev attention ASAP.
Agreed, but I'd prefer a hack over months and months of annoyance for hundreds of developers. Unfortunately, I don't have time to fix the underlying issue.
Agreed, but I'd prefer a hack over months and months of annoyance for hundreds of developers. Unfortunately, I don't have time to fix the underlying issue.
We upgraded from Jenkins 1.494 to 1.498 and all of the sudden, Remember Me stopped working. The server is running on a small EC2 instance with Amazon's standard AMI. After a few days, I downgraded us back to 1.494 and Remember Me started working again.
We upgraded from Jenkins 1.494 to 1.498 and all of the sudden, Remember Me stopped working. The server is running on a small EC2 instance with Amazon's standard AMI. After a few days, I downgraded us back to 1.494 and Remember Me started working again.
Just FYI for those of you who would like to see an immediate fix for this merged into the next version. A debate is happening at #674 and chances are that nothing will be done soon if more people aren't interested in a quick solution. Please chime in if you have an opinion.
It seems to me, that this is related to the way winstone generates the Expires-field for cookies. When using tomcat as a conatiner I can not reproduce the problems described, only using winstone. The differenc is, tomcat uses a four digit year field and winstone uses 2 digits.
It seems to me, that this is related to the way winstone generates the Expires-field for cookies. When using tomcat as a conatiner I can not reproduce the problems described, only using winstone. The differenc is, tomcat uses a four digit year field and winstone uses 2 digits.
The workaround also won't work if you're not using AD.
We don't use AD, we use a local script for login.
Yet Jenkins keeps logging me out, several times each day.
Why?
The workaround also won't work if you're not using AD.
We don't use AD, we use a local script for login.
Yet Jenkins keeps logging me out, several times each day.
Why?
@Kohsuke We have Jenkins 1.577 installation with AD and have this issue, but I see that your fix went into 1.556 itself. Could I be seeing a corner case?
@Kohsuke We have Jenkins 1.577 installation with AD and have this issue, but I see that your fix went into 1.556 itself. Could I be seeing a corner case?
Activity
jenkins-infra-bot commentedon Apr 6, 2011
Raw content of original comment:
I also get this issue, using as a windows service
jenkins-infra-bot commentedon Apr 15, 2011
Raw content of original comment:
Are you running several Hudson instances on the same server, but on different ports (e.g. myserver:8080, myserver:8081, myserver:8082)?
The browser cookies that are used to track your successful login unfortunately only store the server name of the URL (e.g. myserver), but not the port (e.g. 8080, 8081, 8082). Thus, if you log into the Hudson instance of server myserver:8080 and then into myserver:8081, the browser cookie for 'myserver' will now track your session on myserver:8081. This essentially logs you out of myserver:8080.
jenkins-infra-bot commentedon Apr 15, 2011
mfn:
Raw content of original comment:
In my case, no, I'm only running on instance at one port on a given hostname.
More specific, I'm running the Debian package on port 8081 but accessing it via apache on port 80 with mod_proxy, my virtualhost looks like this:
jenkins-infra-bot commentedon Jan 17, 2012
Raw content of original comment:
Firecookie (with Firebug) reports that the Expires date for ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE is invalid.
Note that the Expires date has hyphens in, which (unlike the Date header) is not valid according to RFC 822.
jenkins-infra-bot commentedon Apr 16, 2012
Raw content of original comment:
We see this a lot at our company, too. We are using Jenkins 1.458 and use the Active Directory plugin for authentication.
We have seen it with clients on various OS / browsers.
I, too, looked at the cookies on my machine with firecookie, and the "Expires" value for ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE seems valid (it expires a couple weeks from now).
We run Jenkins on port 8080, but forward port 80 to 8080 using iptables, but no client uses 8080 (that I know of).
jenkins-infra-bot commentedon Aug 16, 2012
Raw content of original comment:
We run our instance as a simple setup on a ubuntu 10.04 machine. Runs on port 8080 but forwarded from port 80. There is only one url that we use including the port (default, since we use 80 in practice).
Apparently the trick would be to update web.xml to include this right after the description (or later):
This would tell WinStone (or Tomcat) to have a session expiration of 24h (24*60=1440). The problem is that it would require to extract jenkins.war, patch web.xml and re-zip jenkins.war. Not very automated to get the autoupdates.
ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE is set when 'Remember Me' is checked, it seems valid and expire after 2 weeks.
jenkins-infra-bot commentedon Oct 17, 2012
Raw content of original comment:
Same here, Jenkins on Linux and different browsers on Win7. Is there a chance to have it fixed?
Thanks if advance for your response.
jenkins-infra-bot commentedon Nov 8, 2012
moztr:
Raw content of original comment:
Same here too, Jenkins runs on Debian Linux - we always update to the latest version from the jenkins-repository.
Jenkins is accessed via https on port 8443 (using the JENKINS_ARGS to supply the httpsPort argument, keystore et cetera) and use active directory for authentication.
If there's any more information I can supply that'd help in analyzing the problem please let me know.
jenkins-infra-bot commentedon Jan 17, 2013
gatrot:
Raw content of original comment:
This is the most annoying thing about Jenkins at our company.
I have a pull request that incorporates Stephane Odul's session timeout suggestion (with a default of two days). Please comment on the pull request if you'd like to see it approved. The more comments, the more popular, the better chance it has to make it in to the main line. Thanks!
#674
jenkins-infra-bot commentedon Jan 17, 2013
Raw content of original comment:
Stephane Odul's solution is just a hack though. The problem is not that the session expires, it's that the remember me feature does not do anything to make you a new one.
I agree though that it is the most annoying thing about Jenkins and really needs proper dev attention ASAP.
jenkins-infra-bot commentedon Jan 17, 2013
gatrot:
Raw content of original comment:
Agreed, but I'd prefer a hack over months and months of annoyance for hundreds of developers. Unfortunately, I don't have time to fix the underlying issue.
jenkins-infra-bot commentedon Jan 18, 2013
Raw content of original comment:
We upgraded from Jenkins 1.494 to 1.498 and all of the sudden, Remember Me stopped working. The server is running on a small EC2 instance with Amazon's standard AMI. After a few days, I downgraded us back to 1.494 and Remember Me started working again.
jenkins-infra-bot commentedon Jan 18, 2013
Raw content of original comment:
John, the issue with 1.494 is different and tracked in
JENKINS-16278.jenkins-infra-bot commentedon Jan 29, 2013
gatrot:
Raw content of original comment:
Just FYI for those of you who would like to see an immediate fix for this merged into the next version. A debate is happening at #674 and chances are that nothing will be done soon if more people aren't interested in a quick solution. Please chime in if you have an opinion.
jenkins-infra-bot commentedon Feb 1, 2013
Raw content of original comment:
It seems to me, that this is related to the way winstone generates the Expires-field for cookies. When using tomcat as a conatiner I can not reproduce the problems described, only using winstone. The differenc is, tomcat uses a four digit year field and winstone uses 2 digits.
37 remaining items
jenkins-infra-bot commentedon Mar 11, 2014
Raw content of original comment:
Implemented this in Active Directory plugin 1.35 in conjunction with core changes scheduled for 1.556.
A work around in the mean time is to make sure you have bind DN and password.
jenkins-infra-bot commentedon Mar 12, 2014
aflat:
Raw content of original comment:
That workaround doesn't work if your master is on a windows 2008 machine, since you can't enter a bind DN/password, since those fields are hidden.
jenkins-infra-bot commentedon Mar 13, 2014
m_broida:
Raw content of original comment:
The workaround also won't work if you're not using AD.
We don't use AD, we use a local script for login.
Yet Jenkins keeps logging me out, several times each day.
Why?
jenkins-infra-bot commentedon Feb 12, 2015
haridsv:
Raw content of original comment:
@Kohsuke We have Jenkins 1.577 installation with AD and have this issue, but I see that your fix went into 1.556 itself. Could I be seeing a corner case?
jenkins-infra-bot commentedon Nov 24, 2025
[Original
is_duplicated_byfrom Jira: JENKINS-9257]jenkins-infra-bot commentedon Nov 24, 2025
[Original
relates_tofrom Jira: JENKINS-16278]