mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixing the DatabaseSession to work with models that use a different primary key field than id.
This commit is contained in:
parent
87d3a2ef19
commit
98e29b7246
1 changed files with 4 additions and 1 deletions
|
@ -110,7 +110,10 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
|||
return false;
|
||||
}
|
||||
$expires = time() + (Configure::read('Session.timeout') * 60);
|
||||
return ClassRegistry::getObject('Session')->save(compact('id', 'data', 'expires'));
|
||||
$Session = ClassRegistry::getObject('Session');
|
||||
$record = compact('id', 'data', 'expires');
|
||||
$record[$Session->primaryKey] = $id;
|
||||
return $Session->save($record);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue