mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-12 20:49:50 +00:00
Reducing redundant code for CakeSession.
This commit is contained in:
parent
725bfc3e12
commit
afede663c0
1 changed files with 7 additions and 9 deletions
|
@ -222,12 +222,11 @@ class CakeSession {
|
|||
* @return boolean True if session was started
|
||||
*/
|
||||
public static function start() {
|
||||
if (self::started()) {
|
||||
return true;
|
||||
if (!self::started()) {
|
||||
session_write_close();
|
||||
self::__initSession();
|
||||
self::_startSession();
|
||||
}
|
||||
session_write_close();
|
||||
self::__initSession();
|
||||
self::_startSession();
|
||||
return self::started();
|
||||
}
|
||||
|
||||
|
@ -661,10 +660,9 @@ class CakeSession {
|
|||
* @return void
|
||||
* @access private
|
||||
*/
|
||||
function __regenerateId() {
|
||||
$oldSessionId = session_id();
|
||||
if ($oldSessionId) {
|
||||
if (session_id() != ''|| isset($_COOKIE[session_name()])) {
|
||||
public function __regenerateId() {
|
||||
if (session_id()) {
|
||||
if (session_id() != '' || isset($_COOKIE[session_name()])) {
|
||||
setcookie(Configure::read('Session.cookie'), '', time() - 42000, self::$path);
|
||||
}
|
||||
session_regenerate_id(true);
|
||||
|
|
Loading…
Add table
Reference in a new issue