Is there any ways to force a customer to log out? The use case is that after changing the customer’s group in backend, i would need to force him to log out and log back in to see the new prices for his new group. I’m not trying to log the current user out so can’t use Mage::getSingleton('customer/session')->logout()
I looked into sessions but there seems to be no way to init a session from a customer’s ID
What i tried was setting customer id directly but it doesn’t work
$session = Mage::getModel('customer/session')->loginById(1234)->logout();
2
Answers
You can use
Mage::getSingleton('customer/session')->logout()
or redirect the customer to the below urlHow to force magento to logout
This is how you find and delete Magento 1 customer session files.
.../customer/edit/id/666/
=> 666Magento_Root/var/session/
(replace 666 with actual customer id)
One-liner for steps 4. and 5., use with caution! (replace 666 with actual customer id):