Php Magento在会话过期后设置默认存储视图
会话过期后,如何以编程方式设置或重定向用户?在登录中,用户被重定向到指定的存储视图。此存储视图仅对登录的用户可用。当会话过期时,我会将用户重定向到默认的存储视图 我修改了Core/Model/App.php\u checkCookieStore方法Php Magento在会话过期后设置默认存储视图,php,javascript,magento,magento-1.7,Php,Javascript,Magento,Magento 1.7,会话过期后,如何以编程方式设置或重定向用户?在登录中,用户被重定向到指定的存储视图。此存储视图仅对登录的用户可用。当会话过期时,我会将用户重定向到默认的存储视图 我修改了Core/Model/App.php\u checkCookieStore方法 protected function _checkCookieStore($type) { if (!$this->getCookie()->get()) { return $this;
protected function _checkCookieStore($type)
{
if (!$this->getCookie()->get()) {
return $this;
}
$session = Mage::getSingleton('customer/session', array('name'=>'frontend'));
if (!$session->isLoggedIn()) {
unset($_COOKIE['store']);
}
$store = $this->getCookie()->get(Mage_Core_Model_Store::COOKIE_NAME);
if ($store && isset($this->_stores[$store])
&& $this->_stores[$store]->getId()
&& $this->_stores[$store]->getIsActive()) {
if ($type == 'website'
&& $this->_stores[$store]->getWebsiteId() == $this->_stores[$this->_currentStore]->getWebsiteId()) {
$this->_currentStore = $store;
}
if ($type == 'group'
&& $this->_stores[$store]->getGroupId() == $this->_stores[$this->_currentStore]->getGroupId()) {
$this->_currentStore = $store;
}
if ($type == 'store') {
$this->_currentStore = $store;
}
}
return $this;
}
如果会话未记录在日志中,我将取消存储cookie