Permalink
Browse files

CakeSession::__write() now correctly uses the Session model's primary…

…Key instead of hardcoded fieldname "id". Fixed #1129
  • Loading branch information...
1 parent 7e4f9c4 commit e161b41e3cf6efe540feede24b5ef90f98f887d2 @ADmad ADmad committed Sep 23, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 cake/libs/cake_session.php
@@ -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;
@@ -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;
}

0 comments on commit e161b41

Please sign in to comment.