From: Michael M Slusarz Date: Thu, 8 Oct 2009 22:23:15 +0000 (-0600) Subject: The write/close should be done in the destructor X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=26342de93e320328b5b72a8feb9ba95809b9deb5;p=horde.git The write/close should be done in the destructor --- diff --git a/framework/SessionHandler/lib/Horde/SessionHandler.php b/framework/SessionHandler/lib/Horde/SessionHandler.php index 54812dffe..b12cf559b 100644 --- a/framework/SessionHandler/lib/Horde/SessionHandler.php +++ b/framework/SessionHandler/lib/Horde/SessionHandler.php @@ -132,6 +132,17 @@ class Horde_SessionHandler } /** + * Destructor. + */ + public function __destruct() + { + /* This is necessary as of PHP 5.0.5 because objects are not available + * when the write() handler is called at the end of a session + * access. */ + session_write_close(); + } + + /** * Shutdown function. * * Used to determine if we need to write the session to avoid a session @@ -152,11 +163,6 @@ class Horde_SessionHandler $_SESSION['sessionhandler'] = $curr_time + (ini_get('session.gc_maxlifetime') / 2); $this->_force = true; } - - /* This is necessary as of PHP 5.0.5 because objects are not available - * when the write() handler is called at the end of a session - * access. */ - session_write_close(); } /**