From 6d3f5186489916f98ad65289ed0a2222437aa68a Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 30 Mar 2008 18:42:15 +0000 Subject: [PATCH] - Fix the multiple cookie bugs if SFIABDIRECTORY=='' and the user visits '/admin' or some other subdir first. Setting the cookie directory to '' seems to mean that PHP sets it to the current directory. We want it to be set to '/'. --- common.inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common.inc.php b/common.inc.php index fb48b94..fba4ae2 100644 --- a/common.inc.php +++ b/common.inc.php @@ -180,8 +180,13 @@ while($r=mysql_fetch_object($q)) require_once("committee.inc.php"); -session_name("SFIABSESSID".ereg_replace("[^A-Za-z]","_",$config['SFIABDIRECTORY'])); -session_set_cookie_params(0,$config['SFIABDIRECTORY']); +if($config['SFIABDIRECTORY'] == '') { + session_name("SFIABSESSID"); + session_set_cookie_params(0,'/'); +} else { + session_name("SFIABSESSID".ereg_replace("[^A-Za-z]","_",$config['SFIABDIRECTORY'])); + session_set_cookie_params(0,$config['SFIABDIRECTORY']); +} session_start(); //detect the browser first, so we know what icons to use - we store this in the config array as well