Magento会话过期后设置默认商店视图

How can I set programmatically or redirect the user after the session expired? In login the user is redirected to a specified store view. This store view is available only for the logged in users. when the session expired I would redirect the user the default store view.

I modified the Core/Model/App.php _checkCookieStore method

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;
    }  

If session is not loggedin I unset the store cookie.