Skip to content
Permalink
Browse files

Reducing redundant code for CakeSession.

  • Loading branch information...
predominant authored and markstory committed Jul 22, 2010
1 parent 725bfc3 commit afede663c08f9c12bb79dbb339fd1cfec768135f
Showing with 7 additions and 9 deletions.
  1. +7 −9 cake/libs/cake_session.php
@@ -222,12 +222,11 @@ protected function _setupDatabase() {
* @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 @@ protected static function _checkValid() {
* @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);

0 comments on commit afede66

Please sign in to comment.
You can’t perform that action at this time.