I downloaded 1.8 version and installed it on my localhost, when i was done with install, i tried logging into backend. But it won't let me login, neither it gives me any error but refresh the admin page, i tried giving it wrong password and it prompted about invalid username and password. If so, why isn't my password and login working whereas there is no message of invalid login or password. just same admin page reloads?

  • 3
    Don't use localhost as base url. Use or a virtual host.
    – Marius
    Oct 20, 2013 at 10:53

3 Answers 3


Instead of using localhost I used This solved the issue.


This has happened to me before when using a URL without a FQDN, for example magedev. I had to change it to magedev.local in order to get Magento working correctly. Not using the FQDN also caused Magento to not install the database fully (all of the tables were there but some of the core data was missing).

Another solution, if you are sure that you are using a FQDN and Magento has installed itself correctly, is to try clearing all of your domain cookies. I've ran into an issue before with them getting "stuck" for lack of a better term and not allowing me to log in.


Open the File : app\code\core\Mage\Core\Model\Session\Abstract... and check the code in

 $cookieParams = array(
        'lifetime' => $cookie->getLifetime(),
        'path'     => $cookie->getPath(),
        'domain'   => $cookie->getConfigDomain(),
        'secure'   => $cookie->isSecure(),
       'httponly' => $cookie->getHttponly()

Comment the last three array parameters( domain, secure, httponly)and then try to login

If the issue is the same then comment the

if (isset($cookieParams['domain'])) {
            $cookieParams['domain'] = $cookie->getDomain();

        call_user_func_array('session_set_cookie_params', $cookieParams);

        if (!empty($sessionName)) {

and try to login .. surly it will work for you. :)

  • 1
    Why you need to change core file?
    – mageUz
    Oct 20, 2013 at 14:56
  • @MagnetoBoy The first trick worked, why wasn't it working before?
    – localhost
    Oct 20, 2013 at 16:42
  • 1
    Generally, it seems like browser is not storing the cookies as domain name is not specified. Instead of commenting, you can try by using IP such as htp:// in place of localhost/magento. I personally like to use localhost/magento way so I comment that.
    – MagentoBoy
    Oct 20, 2013 at 17:00
  • Editing a core file should never be the correct answer. Oct 21, 2013 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.