Closes #5542 Duplicate cookies

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7735 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2008-10-12 03:29:10 +00:00
parent aa248a126f
commit 3c50e54213

View file

@ -608,21 +608,23 @@ class CakeSession extends Object {
if (isset($_COOKIE[session_name()])) {
setcookie(Configure::read('Session.cookie'), '', time() - 42000, $this->path);
}
session_regenerate_id();
$newSessid = session_id();
session_regenerate_id(true);
if (PHP_VERSION < 5.1) {
$newSessid = session_id();
if (function_exists('session_write_close')) {
session_write_close();
if (function_exists('session_write_close')) {
session_write_close();
}
$this->__initSession();
session_id($oldSessionId);
session_start();
session_destroy();
$file = $sessionpath . DS . "sess_$oldSessionId";
@unlink($file);
$this->__initSession();
session_id($newSessid);
session_start();
}
$this->__initSession();
session_id($oldSessionId);
session_start();
session_destroy();
$file = $sessionpath . DS . "sess_$oldSessionId";
@unlink($file);
$this->__initSession();
session_id($newSessid);
session_start();
}
}
/**