From a029eceb9db13a6d4340d98ce65f5bdca6e28f2a Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Mon, 29 Sep 2014 10:55:46 +0100 Subject: [PATCH] Set session_save_path & fix logout URL Some hosts have a loop around issue with no session being available after a header location redirect After much research, I've found this is due to some hosts not having a session save path and it needs to be set using PHP Setting this means ICEcoder works on those few hosts Fix to bad URL on logout --- lib/settings-common.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/settings-common.php b/lib/settings-common.php index f826ca3..e21ef6a 100644 --- a/lib/settings-common.php +++ b/lib/settings-common.php @@ -16,7 +16,10 @@ $context = stream_context_create(array('http'=> )); // Start a session if we haven't already -if(!isset($_SESSION)) {@session_start();} +if(!isset($_SESSION)) { + session_save_path(dirname(__FILE__).'/../tmp'); + @session_start(); +} // Set the language file $text = $_SESSION['text']; @@ -28,7 +31,7 @@ if (isset($_GET['logout'])) { $_SESSION['loggedIn']=false; $_SESSION['username']=false; session_destroy(); - header("Location: dirname(__FILE__)./?loggedOut"); + header("Location: ".dirname(__FILE__)."/?loggedOut"); } // If magic quotes are still on (attempted to switch off in php.ini)