I am using an observer with this event customer_register_success.I want to redirect my new customer to cart after the registration. This is my code from my observer:

$customer = $observer->getEvent()->getCustomer();
if ($customer){ // customer new registration after
   //Mage::app()->getResponse()->setRedirect($lastUrl); // This doesn't work
   Mage::app()->getResponse()->sendResponse(); // This works but the customer is not logged in.

If you check my comments from the code. How can i make the user to be redirected and to be logged in too ?


1 Answer 1


This piece of code did the job:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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