Posted by BogdanN on December 10, 2009 at 7:28pm
3 followers
Jump to:
| Project: | No Anonymous Sessions |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I don't know if it's of any help to anybody, but when a users logs out, the cookie with the session is kept, so that prevents Varnish, for instance, to cache the pages.
Solution:
Replace inside session_read, this:
// We didn't find the client's record (session has expired), or they are an anonymous user.
else {
$session = isset($user->session) ? $user->session : '';
$user = drupal_anonymous_user($session);
}
with
else {
ini_set('session.use_cookies', 0);
$user = drupal_anonymous_user();
$cookie_params = session_get_cookie_params();
setcookie(session_name(), '', time() - 42000, '/', $cookie_params['domain']);
return '';
}
Comments
#1
Subscribing.
#2
Subscribing.