本文整理汇总了PHP中Zend\Session\SessionManager::forgetMe方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionManager::forgetMe方法的具体用法?PHP SessionManager::forgetMe怎么用?PHP SessionManager::forgetMe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Session\SessionManager
的用法示例。
在下文中一共展示了SessionManager::forgetMe方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logout
public function logout()
{
if ($this->authService->hasIdentity()) {
$this->authService->clearIdentity();
$this->sessionManager->forgetMe();
}
}
示例2: authListener
/**
* @param AuthenticationEvent $e
*/
public function authListener(AuthenticationEvent $e)
{
$result = $e->getResult();
if ($result->isValid()) {
if ($this->rememberMe) {
$this->sessionManager->rememberMe();
} else {
$this->sessionManager->forgetMe();
}
$this->sessionManager->writeClose();
}
}
示例3: logoutAction
public function logoutAction()
{
$auth = new AuthenticationService();
if ($auth->hasIdentity()) {
$identity = $auth->getIdentity();
$auth->clearIdentity();
$sessionManager = new SessionManager();
$sessionManager->forgetMe();
}
$this->redirect()->toRoute('backend_login');
}
示例4: logoutAction
/**
* Log out action
*
* The method destroys session for a logged user
*
* @return redirect to specific action
*/
public function logoutAction()
{
$auth = $this->getServiceLocator()->get('Zend\\Authentication\\AuthenticationService');
if ($auth->hasIdentity()) {
$auth->clearIdentity();
$sessionManager = new SessionManager();
$sessionManager->forgetMe();
}
return $this->redirect()->toRoute($this->getOptions()->getLogoutRedirectRoute());
}
示例5: logoutAction
public function logoutAction()
{
$auth = new AuthenticationService();
$auth->clearIdentity();
$sessionManager = new SessionManager();
$sessionManager->forgetMe();
return $this->redirect()->toRoute('user-auth');
}
示例6: logoutAction
public function logoutAction()
{
$auth = $this->authService;
if ($auth->hasIdentity()) {
$auth->clearIdentity();
// remove user data
$userContainer = new Container('User');
$userContainer->getManager()->getStorage()->clear('User');
// forget-me
$sessionManager = new SessionManager();
$sessionManager->forgetMe();
}
return $this->redirect()->toRoute('authentication/login');
}
示例7: logoutAction
/**
*/
public function logoutAction()
{
$loSession = new Session();
$loIdentity = $loSession->getRegister('OnionAuth');
//$loAuth = $this->getServiceLocator()->get('Zend\Authentication\AuthenticationService');
//if ($loAuth->hasIdentity())
if (is_object($loIdentity)) {
//$loIdentity = $loAuth->getIdentity();
Debug::debug('[THERE IS IDENTITY]');
Access::log($loIdentity, "LOGOUT");
}
//$loAuth->clearIdentity();
$loSession = new Session();
$loSession->clearRegister('OnionAuth');
$loSession->clearRegister('storage', 'Zend_Auth');
$loSessionManager = new SessionManager();
$loSessionManager->forgetMe();
Debug::debug('[LOGOUT]');
return $this->redirect()->toRoute('application', array('controller' => 'application', 'action' => 'index'));
}
示例8: getSessionAdapter
/**
* Retorna o adaptador de sessao
* @param string $name
* @return SessionContainer
*/
public function getSessionAdapter($name = 'Default')
{
if (!isset($_SESSION[$name])) {
$sessionConfig = new SessionConfig();
$sessionConfig->setOptions($this->globalConfig['session']);
$sessionStorage = new \Zend\Session\Storage\SessionArrayStorage();
$sessionManager = new SessionManager();
$sessionManager->rememberMe($this->globalConfig['session']['remember_me_seconds']);
$sessionManager->forgetMe();
$sessionManager->setConfig($sessionConfig);
$sessionManager->setStorage($sessionStorage);
$sessionNamespace = new SessionContainer($name, $sessionManager);
$sessionNamespace->setExpirationSeconds(3600);
if (!isset($sessionNamespace->init)) {
$request = new \Zend\Http\PhpEnvironment\Request();
$sessionNamespace->init = 1;
$sessionNamespace->remoteAddr = $request->getServer('REMOTE_ADDR');
$sessionNamespace->httpUserAgent = $request->getServer('HTTP_USER_AGENT');
/*
$chain = $sessionManager->getValidatorChain();
$validatorUserAgent = new \Zend\Session\Validator\HttpUserAgent($sessionNamespace->httpUserAgent);
$chain->attach('session.validate', array($validatorUserAgent, 'isValid'));
$validatorAddr = new \Zend\Session\Validator\RemoteAddr($sessionNamespace->remoteAddr);
$chain->attach('session.validate', array($validatorAddr, 'isValid'));
$sessionManager->setValidatorChain($chain);
*
*/
}
$sessionNamespace->setDefaultManager($sessionManager);
} else {
$sessionNamespace = new SessionContainer($name);
$sessionNamespace->setExpirationSeconds(3600);
}
$this->sessionAdapter = $sessionNamespace;
return $sessionNamespace;
}
示例9: logoutAction
public function logoutAction()
{
$auth = new AuthenticationService();
if ($auth->hasIdentity()) {
$identity = $auth->getIdentity();
$this->getLoginTable()->deleteSession($identity->username);
}
$auth->clearIdentity();
$session_manager = new SessionManager();
$session_manager->forgetMe();
return $this->redirect()->toUrl('/login/log');
}