diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-11 22:41:20 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-11 22:41:20 +0000 |
commit | 0b347f3a999fd8e0e8f7961c991b1b25ed0b1b4a (patch) | |
tree | 1c4953cc041a8e51ae8a9d231b54643c88680a06 /includes/session.inc | |
parent | 77a72824207be8aced0fe11010f6a1abae471078 (diff) | |
download | brdo-0b347f3a999fd8e0e8f7961c991b1b25ed0b1b4a.tar.gz brdo-0b347f3a999fd8e0e8f7961c991b1b25ed0b1b4a.tar.bz2 |
#93945 by chx. Save sessions before objects are destroyed on some configurations.
Diffstat (limited to 'includes/session.inc')
-rw-r--r-- | includes/session.inc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/session.inc b/includes/session.inc index e18845ae4..4c61bb637 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -17,6 +17,11 @@ function sess_close() { function sess_read($key) { global $user; + // Write and Close handlers are called after destructing objects since PHP 5.0.5 + // Thus destructors can use sessions but session handler can't use objects. + // So we are moving session closure before destructing objects. + register_shutdown_function('session_write_close'); + // Handle the case of first time visitors and clients that don't store cookies (eg. web crawlers). if (!isset($_COOKIE[session_name()])) { $user = drupal_anonymous_user(); |