But if you’d like to redirect the customer back to the product/page he was visiting before.
Login to Magento Admin.
Go to System -> Configuration -> Customer Configuration -> Login Options.
From the drop-down select “no” and save configuration.
Refresh the cache and try to login.
Hope! you will enjoy.