本文整理汇总了PHP中Cake\Network\Session::renew方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::renew方法的具体用法?PHP Session::renew怎么用?PHP Session::renew使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Network\Session
的用法示例。
在下文中一共展示了Session::renew方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renew
/**
* Used to renew a session id
*
* In your controller: $this->Session->renew();
*
* @return void
*/
public function renew()
{
return Session::renew();
}
示例2: logout
/**
* Log a user out.
*
* Returns the logout action to redirect to. Triggers the `Auth.logout` event
* which the authenticate classes can listen for and perform custom logout logic.
* AuthComponent will remove the session data, so there is no need to do that
* in an authentication object. Logging out will also renew the session id.
* This helps mitigate issues with session replays.
*
* @return string Normalized config `logoutRedirect`
* @link http://book.cakephp.org/3.0/en/controllers/components/authentication.html#logging-users-out
*/
public function logout()
{
$this->_setDefaults();
if (empty($this->_authenticateObjects)) {
$this->constructAuthenticate();
}
$user = (array) $this->user();
$this->dispatchEvent('Auth.logout', [$user]);
$this->session->delete($this->sessionKey);
$this->session->delete('Auth.redirect');
$this->session->renew();
return Router::normalize($this->_config['logoutRedirect']);
}
示例3: renew
/**
* Used to renew a session id
*
* In your controller: $this->Session->renew();
*
* @return void
*/
public function renew()
{
$this->_session->renew();
}
示例4: delete
/**
* Delete user record from session.
*
* The session id is also renewed to help mitigate issues with session replays.
*
* @return void
*/
public function delete()
{
$this->_user = false;
$this->_session->delete($this->_config['key']);
$this->_session->renew();
}