Merge pull request #1912 from MPOS/cookie-domain-fix
[FIX] Changing Cookie Domain
This commit is contained in:
commit
0f13bd7c4f
@ -19,13 +19,13 @@ if (!include_once(BASEPATH . 'include/config/security.inc.dist.php')) die('Unabl
|
|||||||
if (@file_exists(BASEPATH . 'include/config/security.inc.php')) include_once(BASEPATH . 'include/config/security.inc.php');
|
if (@file_exists(BASEPATH . 'include/config/security.inc.php')) include_once(BASEPATH . 'include/config/security.inc.php');
|
||||||
|
|
||||||
// start our session, we need it for smarty caching
|
// start our session, we need it for smarty caching
|
||||||
$session_start = @session_start();
|
|
||||||
session_set_cookie_params(time()+$config['cookie']['duration'], $config['cookie']['path'], $config['cookie']['domain'], $config['cookie']['secure'], $config['cookie']['httponly']);
|
session_set_cookie_params(time()+$config['cookie']['duration'], $config['cookie']['path'], $config['cookie']['domain'], $config['cookie']['secure'], $config['cookie']['httponly']);
|
||||||
|
$session_start = @session_start();
|
||||||
if (!$session_start) {
|
if (!$session_start) {
|
||||||
$log->log("info", "Forcing session id regeneration, session failed to start [hijack attempt?]");
|
$log->log("info", "Forcing session id regeneration, session failed to start [hijack attempt?]");
|
||||||
session_destroy();
|
session_destroy();
|
||||||
session_regenerate_id(true);
|
session_regenerate_id(true);
|
||||||
session_start();
|
session_start();
|
||||||
}
|
}
|
||||||
@setcookie(session_name(), session_id(), time()+$config['cookie']['duration'], $config['cookie']['path'], $config['cookie']['domain'], $config['cookie']['secure'], $config['cookie']['httponly']);
|
@setcookie(session_name(), session_id(), time()+$config['cookie']['duration'], $config['cookie']['path'], $config['cookie']['domain'], $config['cookie']['secure'], $config['cookie']['httponly']);
|
||||||
|
|
||||||
|
|||||||
@ -624,10 +624,7 @@ class User extends Base {
|
|||||||
// Unset all of the session variables
|
// Unset all of the session variables
|
||||||
$_SESSION = array();
|
$_SESSION = array();
|
||||||
// As we're killing the sesison, also kill the cookie!
|
// As we're killing the sesison, also kill the cookie!
|
||||||
if (ini_get("session.use_cookies")) {
|
setcookie(session_name(), '', time() - 42000);
|
||||||
$params = session_get_cookie_params();
|
|
||||||
setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"]);
|
|
||||||
}
|
|
||||||
// Destroy the session.
|
// Destroy the session.
|
||||||
session_destroy();
|
session_destroy();
|
||||||
// Enforce generation of a new Session ID and delete the old
|
// Enforce generation of a new Session ID and delete the old
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user