当前位置: 首页>>代码示例>>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;未经允许,请勿转载。