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
This commit is contained in:
Matt Pass
2014-09-29 10:55:46 +01:00
parent 7ef86360d8
commit a029eceb9d

View File

@@ -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)