when you are working with the magento, some time after successful installation of magento you are not able to login into admin panel of magento. This issue is arise with many developer but its really very simple to resolve it. i will discuss it in this post.
whenever you access admin panel and provide wrong username and password or vice versa then it display message that “Invalid Username or Password.” while when you insert correct password then it does not show anything.
After many try you will look in the code and database and try to reset username and password but this is not the problem. actual problem is magneto could not store cookies. most of all developer run it on local server so the url is start from localhost but localhost is not true domain and if you are aware with the cookies then we need true domain to store cookies. This is the reason its not display any message and not able to access the control panel.
If we need to run this without any problem then we can do it and there is two way to do this.
1) You can run your magento project on the IP Address like http://127.0.0.1 instead of http://localhost. i test it and its working fine when you work on IP address.
2) You need to edit on magento file named ‘Varien.php’ which is located in app/code/core/Mage/Core/Model/Session/Abstract/ folder within your magento directory. might be you need to adjust it as per your installation folder. below is the code which you need to replace in you file.
Search Below code session_set_cookie_params($this->getCookie()->getLifetime(),$this->getCookie()->getPath(),$this->getCookie()->getDomain(),$this->getCookie()->isSecure(),$this->getCookie()->getHttponly()); and Replace it with session_set_cookie_params($this->getCookie()->getLifetime(),$this->getCookie()->getPath());
I hope this will be helpful to you for your project related work.
Note: if you are not aware of cookies then you can read my articles in this blog which is related with cookies.