1

While customer is logged in to the Customer Account page, for example, the URL looks something like https://www.oursite.com/customer/account/?SID=<randomstring>. URL is copied, customer account is logged out, then the copied URL is pasted. The Customer Account page is redisplayed, even though customer is already logged out. How do we get around this?

2

UPDATE: Ah ok, make sense.

Then you can just hook into:

Mage::dispatchEvent('controller_action_predispatch_' . $this->getFullActionName(), array('controller_action' => $this));

which should be controller_action_predispatch_customer_account_index and check for the no-dispatch flag:

\Mage_Customer_AccountController::preDispatch
if (!preg_match($pattern, $action)) {
    if (!$this->_getSession()->authenticate($this)) {
        $this->setFlag('', 'no-dispatch', true); // <<----------------
    }

If this flag exists, just redirect wherever you want to. UPDATE END

You mean, the customer is logged out with a click on the logout button?

This shouldn't be possible.

You can only view the account page, when the user is logged in, this means if he has a session. And this session is destroyed while logging out:

\Mage_Customer_AccountController::logoutAction()
-> \Mage_Customer_Model_Session::logout()
-> \Mage_Customer_Model_Session::_logout()
protected function _logout()
{
    $this->setId(null);
    $this->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
    $this->getCookie()->delete($this->getSessionName());
    return $this;
}

So please check whether the session exists on your disk or in the database and check wether the above code is hit.

  • actually, when the Customer Account page is "redisplayed" it is empty. But we don't want the page to display altogether. – Obay Jan 7 '14 at 8:06
  • updated... 8 more to go... – Fabian Blechschmidt Jan 7 '14 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.