本文整理汇总了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);
}
}