I have been working on a site that requires users to be logged in and approved before they can access the website. That element works fine, except if as an administrator I edit the customer's account to revoke their access.
Refreshing the page as that (already logged in) customer, I expect to be logged out and redirected to the login page. Instead, I am able to continue to remain logged in.
I have been looking for a way to try and programatically (on save of customer) to log that customer out.
$session = Mage::getSingleton('customer/session'); $session->loginById($customer->getId()); // Log Out the customer. $session->logout();
This I have been trying to use, unfortunately, instead of logging out the customer, it logs me out from the admin instead.
So it seems that I need to have something like
$customer->getSessionId() and load the session from that, but that doesn't seem to exist as a route.
As an alternative work around, I expect it might be possible to override the session itself on reinitialise on the customer view, but this feels like it might be unnecessarily convoluted.