The follwoing code should redirect a customer after log in. Just ensure, the event “customer_login” is used in root/app/code/local/NameSpace/ModuleName/etc/config.xml file. Once the event is observed, put the following code under observer method.
<?php
//redirect to checkout after login
$session = Mage::getSingleton('customer/session');
if (strpos(Mage::helper('core/http')->getHttpReferer(), 'checkout/cart') === false) {
$session->setAfterAuthUrl(Mage::getUrl('checkout/cart/index'));
}
else {
$session->setAfterAuthUrl(Mage::helper('core/http')->getHttpReferer());
}
If we need to redirect customer to a different page other than
checkout/cart/index
we can use any page url in Magento way frontname/controllername/action