I have developed a custom module with the help from @Marius, that allows a customer support team member to select a customer from the customer list in the admin section and logs them in as the customer and then redirects to shop.
I now need to the opposite, from a custom page in the client side I need to:
- Clear the customer session
- Redirect back to the customer list in the admin section.
This is the code I have in a new controller:
// get customer list in admin section URL $customerUrl = Mage::helper('adminhtml')->getUrl('adminhtml/customer/index'); // Logout customer session Mage::getSingleton('customer/session')->logout()->renewSession(); // Redirect to customers page in admin section Mage::app()->getFrontController()->getResponse()->setRedirect($customerUrl);
This code kind works but I get redirect to the admin dashboard.
Please can you point me in the direction