Magento can’t login admin panel after installed

If you are not installed magento previously this is a problem you faced.After installation magento returns a message that the installation was successful and you can proceed to the administration panel. Although providing the correct username / password, magento does not show anything. Providing wrong username / password , magento returns the message “Invalid Username or Password”.If you login from different browser same effect will happening.

The login attempt was made through the “localhost ” or ” socket , but you can’t log in to admin panel.The problem occurs because magneto could not store cookies. Localhost and “ are not true domains , and browsers allow only real domains to store cookies ,that’s why login stops without any indication.

If not success read the configurations of your server through phpinfo() file, is the module “mode_rewrite” loaded?


If you are using change it into localhost.If you are using localhost change it into
Then try to login.



1-Go to following file and open it.I’m using is


2-Search for “// session cookie params” line(77) .


3-Comment the below mentioned code(line number 86).

Final script like this.
Magento can’t login admin panel after installed

4-Now login as admin, it will work!


Go to the following folder and delete all folders in it.

Try to log into the admin panel.


Go to the database and open “core_config_data” table and find the correct data is exist in the following records.

That’s only.

Published by

Sumith Harshan

Sumith Harshan is the Web Engineer Specializes in Java Script, JQuery, HTML4/5, CSS2/3, PHP, CodeIgniter, CakePHP, J2SE, J2EE, XML, Hacking & Security, Mobile Interface Developing, Magento, Wordpress, Joomla, Drupal,PHPBB,Facebook App Developing and Open cart...etc.