Skip to content

[JENKINS-9258] "Remember me" doesn't work with Active Directory plugin #15727

Closed

Description

@jenkins-infra-bot

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


Originally reported by mfn, imported from: "Remember me" doesn't work with Active Directory plugin
  • assignee: kohsuke
  • status: Resolved
  • priority: Major
  • component(s): active-directory-plugin, core
  • resolution: Fixed
  • resolved: 2014-03-11T23:36:51+00:00
  • votes: 75
  • watchers: 76
  • imported: 2025-11-24
Raw content of original issue

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

Activity

  1. jenkins-infra-bot commented on Apr 6, 2011

    @jenkins-infra-bot
    Author
    muff0:
    • Original comment link
    • Raw content of original comment:

      I also get this issue, using as a windows service

    I also get this issue, using as a windows service

  2. jenkins-infra-bot commented on Apr 15, 2011

    @jenkins-infra-bot
    Author
    swiest:
    • Original comment link
    • 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.

    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.

  3. jenkins-infra-bot commented on Apr 15, 2011

    @jenkins-infra-bot
    Author
    mfn:
    • Original comment link
    • 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:

      <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>
    
  4. jenkins-infra-bot commented on Jan 17, 2012

    @jenkins-infra-bot
    Author
    jameshowe:
    • Original comment link
    • Raw content of original comment:

      Firecookie (with Firebug) reports that the Expires date for ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE is invalid.

      Date: Mon, 03 Sep 2012 12:45:56 GMT Set-Cookie: ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE=****; Expires=Mon, 17-Sep-12 12:45:56 GMT; Path=/

      Note that the Expires date has hyphens in, which (unlike the Date header) is not valid according to RFC 822.

    Firecookie (with Firebug) reports that the Expires date for ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE is invalid.

    Date: Mon, 03 Sep 2012 12:45:56 GMT
    Set-Cookie: ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE=****; Expires=Mon, 17-Sep-12 12:45:56 GMT; Path=/

    Note that the Expires date has hyphens in, which (unlike the Date header) is not valid according to RFC 822.

  5. jenkins-infra-bot commented on Apr 16, 2012

    @jenkins-infra-bot
    Author
    njamesp:
    • Original comment link
    • 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).

    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).

  6. jenkins-infra-bot commented on Aug 16, 2012

    @jenkins-infra-bot
    Author
    sodul:
    • Original comment link
    • 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):

          <session-config>
            <session-timeout>1440</session-timeout> 
          </session-config>

      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):

        <session-config>
          <session-timeout>1440</session-timeout> 
        </session-config>
    

    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.

  7. jenkins-infra-bot commented on Oct 17, 2012

    @jenkins-infra-bot
    Author
    weakcamel:
    • Original comment link
    • 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.

    Same here, Jenkins on Linux and different browsers on Win7. Is there a chance to have it fixed?
    Thanks if advance for your response.

  8. jenkins-infra-bot commented on Nov 8, 2012

    @jenkins-infra-bot
    Author
    moztr:
    • Original comment link
    • 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.

    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.

  9. jenkins-infra-bot commented on Jan 17, 2013

    @jenkins-infra-bot
    Author
    gatrot:

    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

  10. jenkins-infra-bot commented on Jan 17, 2013

    @jenkins-infra-bot
    Author
    jameshowe:
    • Original comment link
    • 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.

    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.

  11. jenkins-infra-bot commented on Jan 17, 2013

    @jenkins-infra-bot
    Author
    gatrot:
    • Original comment link
    • 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.

    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.

  12. jenkins-infra-bot commented on Jan 18, 2013

    @jenkins-infra-bot
    Author
    jonhyman:
    • Original comment link
    • 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.

    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.

  13. jenkins-infra-bot commented on Jan 18, 2013

    @jenkins-infra-bot
    Author
    sodul:
    • Original comment link
    • Raw content of original comment:

      John, the issue with 1.494 is different and tracked in JENKINS-16278.

    John, the issue with 1.494 is different and tracked in JENKINS-16278.

  14. jenkins-infra-bot commented on Jan 29, 2013

    @jenkins-infra-bot
    Author
    gatrot:

    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.

  15. jenkins-infra-bot commented on Feb 1, 2013

    @jenkins-infra-bot
    Author
    avogler:
    • Original comment link
    • 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.

    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.

  16. 37 remaining items

  17. jenkins-infra-bot commented on Mar 11, 2014

    @jenkins-infra-bot
    Author
    kohsuke:
    • Original comment link
    • 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.

    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.

  18. jenkins-infra-bot commented on Mar 12, 2014

    @jenkins-infra-bot
    Author
    aflat:
    • Original comment link
    • 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.

    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.

  19. jenkins-infra-bot commented on Mar 13, 2014

    @jenkins-infra-bot
    Author
    m_broida:
    • Original comment link
    • 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?

    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?

  20. jenkins-infra-bot commented on Feb 12, 2015

    @jenkins-infra-bot
    Author
    haridsv:
    • Original comment link
    • 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?

    @​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?

  21. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original is_duplicated_by from Jira: JENKINS-9257]

  22. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-16278]

  23. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions