Explorar o código

Session naming in devel.

Thijs Kinkhorst %!s(int64=22) %!d(string=hai) anos
pai
achega
f0fc6b10b3
Modificáronse 2 ficheiros con 18 adicións e 1 borrados
  1. 9 0
      functions/global.php
  2. 9 1
      include/validate.php

+ 9 - 0
functions/global.php

@@ -13,6 +13,15 @@
  * $Id$
  */
 
+require_once(SM_PATH . 'config/config.php');
+
+/* set the name of the session cookie */
+if(isset($session_name) && $session_name) {  
+    ini_set('session.name' , $session_name);  
+} else {  
+    ini_set('session.name' , 'SQMSESSID');  
+}
+
 /* If magic_quotes_runtime is on, SquirrelMail breaks in new and creative ways.
  * Force magic_quotes_runtime off.
  * chilts@birdbrained.org - I put it here in the hopes that all SM code includes this.

+ 9 - 1
include/validate.php

@@ -26,10 +26,19 @@
  * ** Note this means that for the 1.3.2 release, we should probably
  * recommend that people set session.auto_start=0 to avoid this altogether.
  */
+
 session_write_close();
 
 /* SquirrelMail required files. */
 require_once(SM_PATH . 'class/mime.class.php');
+require_once(SM_PATH . 'config/config.php');
+
+/* set the name of the session cookie */
+if(isset($session_name) && $session_name) {
+    ini_set('session.name' , $session_name);
+} else {
+    ini_set('session.name' , 'SQMSESSID');
+}
 
 session_start();
 
@@ -80,7 +89,6 @@ global $theme;
 unset($theme);
 $theme=array();
 
-require_once(SM_PATH . 'config/config.php');
 require_once(SM_PATH . 'include/load_prefs.php');
 require_once(SM_PATH . 'functions/page_header.php');
 require_once(SM_PATH . 'functions/prefs.php');