From e8c4e3504fe5a6fdae0f412606354eeae95a290c Mon Sep 17 00:00:00 2001 From: stekkel Date: Thu, 6 Apr 2006 12:12:33 +0000 Subject: [PATCH] Handle session.auto_start case and move down squirrelmail version string git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11030 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- include/init.php | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/include/init.php b/include/init.php index 93e87525..d41abd28 100644 --- a/include/init.php +++ b/include/init.php @@ -11,11 +11,9 @@ * @package squirrelmail */ -/** - * SquirrelMail version number -- DO NOT CHANGE - */ -$version = '1.5.2 [CVS]'; + + /** * SquirrelMail internal version number -- DO NOT CHANGE @@ -36,6 +34,7 @@ error_reporting(E_ALL); * If register_globals are on, unregister globals. * Code requires PHP 4.1.0 or newer. */ + if ((bool) @ini_get('register_globals')) { /** * Remove all globals from $_GET, $_POST, and $_COOKIE. @@ -137,15 +136,30 @@ $PHP_SELF = php_self(); * Initialize the session */ +/** set the name of the session cookie */ +if (!isset($session_name) || !$session_name) { + $session_name = 'SQMSESSID'; +} + +/** + * if session.auto_start is On then close the session + */ +$session_autostart_name = session_name(); +if ((isset($session_autostart_name) || $session_autostart_name == '') && + $session_autostart_name !== $session_name) { + $cookiepath = ini_get('session.cookie_path'); + $cookiedomain = ini_get('session.cookie_domain'); + // reset the cookie + setcookie($session_autostart_name,'',time() - 604800,$cookiepath,$cookiedomain); + @session_destroy(); + session_write_close(); +} + /** * includes from classes stored in the session */ require(SM_PATH . 'class/mime.class.php'); -/** set the name of the session cookie */ -if (!isset($session_name) || !$session_name) { - $session_name = 'SQMSESSID'; -} ini_set('session.name' , $session_name); session_set_cookie_params (0, $base_uri); sqsession_is_active(); @@ -161,6 +175,11 @@ if ((bool) @ini_get('register_globals')) { sqsession_register($base_uri, SM_BASE_URI); +/** + * SquirrelMail version number -- DO NOT CHANGE + */ +$version = '1.5.2 [CVS]'; + /** * Retrieve the language cookie */ -- 2.25.1