Store user data in memory on login for stateless auth adapters

This commit is contained in:
Kim Biesbjerg 2016-07-06 00:25:46 +02:00
parent 6bccfe9f40
commit f22129b9c7

View file

@ -611,8 +611,12 @@ class AuthComponent extends Component {
$user = $this->identify($this->request, $this->response);
}
if ($user) {
$this->Session->renew();
$this->Session->write(static::$sessionKey, $user);
if (static::$sessionKey) {
$this->Session->renew();
$this->Session->write(static::$sessionKey, $user);
} else {
static::$_user = $user;
}
$event = new CakeEvent('Auth.afterIdentify', $this, array('user' => $user));
$this->_Collection->getController()->getEventManager()->dispatch($event);
}