in Magento, PHP

Magento redirecting back to the login box after successful login

I have been unable to login to Magento for a few days and after testing every solution suggested in blogs and forums I decided to clear the cache. Turns out this was the solution for me:

rm var/cache/* -rf