本文整理匯總了PHP中Magento\Backend\Model\Auth\Session::destroy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Session::destroy方法的具體用法?PHP Session::destroy怎麽用?PHP Session::destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Backend\Model\Auth\Session
的用法示例。
在下文中一共展示了Session::destroy方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
/**
* Log out user and redirect to new admin custom url
*
* @param \Magento\Framework\Event\Observer $observer
* @return void
* @SuppressWarnings(PHPMD.ExitExpression)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function execute(\Magento\Framework\Event\Observer $observer)
{
if ($this->_coreRegistry->registry('custom_admin_path_redirect') === null) {
return;
}
$this->_authSession->destroy();
$adminUrl = $this->_backendData->getHomePageUrl();
$this->_response->setRedirect($adminUrl)->sendResponse();
exit(0);
}
示例2: execute
/**
* Log out user and redirect him to new admin custom url
*
* @param \Magento\Framework\Event\Observer $observer
* @return void
* @SuppressWarnings(PHPMD.ExitExpression)
*/
public function execute(\Magento\Framework\Event\Observer $observer)
{
if ($this->_coreRegistry->registry('custom_admin_path_redirect') === null) {
return;
}
$this->_authSession->destroy();
$route = $this->_backendData->getAreaFrontName();
$this->_response->setRedirect($this->_storeManager->getStore()->getBaseUrl() . $route)->sendResponse();
exit(0);
}
示例3: aroundProlong
/**
* Admin Session prolong functionality
*
* @param Session $session
* @param \Closure $proceed
* @return mixed
*/
public function aroundProlong(Session $session, \Closure $proceed)
{
if (!$this->sessionsManager->getCurrentSession()->isLoggedInStatus()) {
$session->destroy();
$this->addUserLogoutNotification();
return null;
}
$result = $proceed();
$this->sessionsManager->processProlong();
return $result;
}
示例4: destroy
/**
* {@inheritdoc}
*/
public function destroy(array $options = null)
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'destroy');
if (!$pluginInfo) {
return parent::destroy($options);
} else {
return $this->___callPlugins('destroy', func_get_args(), $pluginInfo);
}
}