當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SessionManager::forgetMe方法代碼示例

本文整理匯總了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();
     }
 }
開發者ID:sauron07,項目名稱:rest_helper,代碼行數:7,代碼來源:UserService.php

示例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();
     }
 }
開發者ID:leogr,項目名稱:zf2-auth-module,代碼行數:15,代碼來源:InteractiveAuth.php

示例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');
 }
開發者ID:rhionair3,項目名稱:myzend,代碼行數:11,代碼來源:LoginController.php

示例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());
 }
開發者ID:KBO-Techo-Dev,項目名稱:MagazinePro-zf25,代碼行數:17,代碼來源:IndexController.php

示例5: logoutAction

 public function logoutAction()
 {
     $auth = new AuthenticationService();
     $auth->clearIdentity();
     $sessionManager = new SessionManager();
     $sessionManager->forgetMe();
     return $this->redirect()->toRoute('user-auth');
 }
開發者ID:jhonmike,項目名稱:zf-user,代碼行數:8,代碼來源:AuthController.php

示例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');
 }
開發者ID:CATSInformatica,項目名稱:CatsSys,代碼行數:14,代碼來源:LoginController.php

示例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'));
 }
開發者ID:m3uzz,項目名稱:module,代碼行數:22,代碼來源:AccessController.php

示例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;
 }
開發者ID:fsvxavier,項目名稱:cityware,代碼行數:42,代碼來源:AbstractActionController.php

示例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');
 }
開發者ID:ponchov,項目名稱:teeforall,代碼行數:12,代碼來源:LoginController.php


注:本文中的Zend\Session\SessionManager::forgetMe方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。