in Magento, PHP

Magento redirecting back to the login box after successful login

I have been unable to login to Magento 1.4.0.1 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