Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I think a more secure policy for session cookies is to set their lifetime to 0 so that they are removed when the browser closes. This reduces the risk of a user on the same client taking advantage of another user's old sessions.
From the testing I have been able to do this seems to fix both the intermittent problem that on logout the display still appears as if a user is not logged out but clicking on new authenticated content gives an access denied; and the problem of being able to see pages previously viewed by authenticated users by using the browser back button after log out.
This gave rise to a discussion of what is the "standard" behaviour for browsers. I do not think that discussion has really taken off. Personally, I do not understand how "standard" behaviour would allow anyone to see content after logging out. That doesn't seem intuitive to me. Nonetheless, I am not attempting to pre-empt any discussion, just writing to ensure you are aware of that thread.
Secondly, there is a discussion on changing settings.php so that the cookie lifetime is zero, http://drupal.org/node/263150
We have found this is needed on Drupal 6.x to ensure that a session ends if a user closes the browser without logging out. Again, this seems to be a necessity and we have implemented it.
Not sure if this is any help to your attempt to clean things up.
A few questions to get this discussion in the direction of this modules purpose... (which is: analyzing a drupal installation and creating a Security Information Report (SIR) about this analysis.)
Is there any 'proof' that a cooky lifetime of 0 is safer?
Would it be of any value for an admin to know what's the current setting?
Can an admin influence this setting at this moment?
Any feedback on this would help me to decide if it's worth implementing it as a feature in the security module.
Perhaps there are proofs out there, but basically that is just common sense. For similar reasons, most banking sites will terminate the session after just a few minutes of inactivity.
If we agree that the cookie lifetime can have an impact on security, however small that impact may be, then yes.
Yes. There is an entry for cookie lifetime in settings.php.
Use of cookies and deletion of them is partially a user responsibility. User should not use public computers for payments, or other sessions where trusted information is required. On the other hand a website is also responsible for (not) setting persistent cookies on trusted/private information.
Therefore it's my believe that it's beneficial security information for a site admin to know what's the actual setting of the cookie lifetime, and I will add it to the Security module.
Comments
Comment #1
VinceW commentedLS,
After taking over maintainership of this module (see: #507278: Request to take over ownership of Security) I'm cleaning up the issue queue.
I postponed it this issue because I would like to know if it still is one.
If no issue in about 2 weeks, I'm going to close it.
Best,
VinceW
-=[ Your Information Matters ]=-
Comment #2
David Lesieur commentedI think a more secure policy for session cookies is to set their lifetime to 0 so that they are removed when the browser closes. This reduces the risk of a user on the same client taking advantage of another user's old sessions.
Comment #3
izmeez commentedPlease excuse me if this is not appropriate to the discussion but it seems to be related to two other issues that seem somewhat inter-related.
There is a long discussion including a core-hack
http://drupal.org/node/197786#comment-1055633
From the testing I have been able to do this seems to fix both the intermittent problem that on logout the display still appears as if a user is not logged out but clicking on new authenticated content gives an access denied; and the problem of being able to see pages previously viewed by authenticated users by using the browser back button after log out.
This gave rise to a discussion of what is the "standard" behaviour for browsers. I do not think that discussion has really taken off. Personally, I do not understand how "standard" behaviour would allow anyone to see content after logging out. That doesn't seem intuitive to me. Nonetheless, I am not attempting to pre-empt any discussion, just writing to ensure you are aware of that thread.
Secondly, there is a discussion on changing settings.php so that the cookie lifetime is zero, http://drupal.org/node/263150
We have found this is needed on Drupal 6.x to ensure that a session ends if a user closes the browser without logging out. Again, this seems to be a necessity and we have implemented it.
Not sure if this is any help to your attempt to clean things up.
Izzy
Comment #4
VinceW commentedA few questions to get this discussion in the direction of this modules purpose... (which is: analyzing a drupal installation and creating a Security Information Report (SIR) about this analysis.)
Any feedback on this would help me to decide if it's worth implementing it as a feature in the security module.
Best,
VinceW
Comment #5
David Lesieur commentedComment #6
VinceW commentedUse of cookies and deletion of them is partially a user responsibility. User should not use public computers for payments, or other sessions where trusted information is required. On the other hand a website is also responsible for (not) setting persistent cookies on trusted/private information.
Therefore it's my believe that it's beneficial security information for a site admin to know what's the actual setting of the cookie lifetime, and I will add it to the Security module.
Best,
VinceW
Comment #7
VinceW commentedChanged status and assignment :-)
Comment #8
pellesimon commentedThe high default cookie lifetime is an unnacceptable security risk for a default installation.
Not logging out can keep an admin logged in for up to 24 days. This should be changed a.s.a.p.
Having your sessions closed on closing your browser is acceptable -- in my opinion a default setting should always respect higher security.
Logging out is not common practice -- please fix it -- I was quite shocked seeing the lifetime so high.
Comment #9
VinceW commentedVery old. Closed because there is going to be a new start of this module.