Skip to content

Commit

Permalink
CakeSession::__write() now correctly uses the Session model's primary…
Browse files Browse the repository at this point in the history
…Key instead of hardcoded fieldname "id". Fixed #1129
  • Loading branch information
ADmad committed Sep 23, 2010
1 parent 7e4f9c4 commit e161b41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cake/libs/cake_session.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ function __initSession() {
}
if ($iniSet && ($this->security === 'high' || $this->security === 'medium')) {
ini_set('session.referer_check', $this->host);
}
}

if ($this->security == 'high') {
$this->cookieLifeTime = 0;
Expand Down Expand Up @@ -753,7 +753,7 @@ function __read($id) {
function __write($id, $data) {
$expires = time() + Configure::read('Session.timeout') * Security::inactiveMins();
$model =& ClassRegistry::getObject('Session');
$return = $model->save(compact('id', 'data', 'expires'));
$return = $model->save(array($model->primaryKey => $id) + compact('data', 'expires'));
return $return;
}

Expand Down

0 comments on commit e161b41

Please sign in to comment.