1

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:

  1. Clear the customer session
  2. 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

Many thanks

Si

1

I think the following snippet should do what you need here.

Mage::app()->getResponse()->setRedirect(Mage::helper('adminhtml')->getUrl("adminhtml/customer/index"));

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.