Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't log in to Magento Admin

I'm having troubles logging into Magento's admin panel on one of our staging sites (it works 100% on our webdev servers and was working just fine not too long ago on the staging server as well).

I've done some research, and most people suggest that it's got to do with running Magento on a localhost and browsers not saving cookies for domains with no dots in the domain name. The problem with that, however is that we're running it from http://staging.sitename... etc.

Another few things that were suggested are where someone changed the default name for accessing the admin in the config, but we haven't changed it.

Does anyone have any ideas that might help?

Thanks for taking the time to help me out!

Kind Regards,
Rémy

like image 239
user223731 Avatar asked Feb 01 '10 11:02

user223731


People also ask

How do I find my Magento admin username and password?

Visit your Magento admin backend in a browser, and click the link Forgot your password. Insert your email address, complete the CAPTCHA, and then press on the Retrieve Password button. An email will be send to your email address, containing a password reset link.

What is the Magento admin login URL?

Default Admin URL and Path: http://yourdomain.com/magento/admin.


2 Answers

I managed to fix it! I found this solution here: http://blog.chapagain.com.np/magento-admin-login-problem/.

I wanted to know why that fixed it though and var_dumped the items I commented out and realized that the cookie domain was being set to just '/' and we have magento set up under '/shop/'. So I went to the configuration section (having managed to log in after commenting out the 3 lines mentioned in the article), changed the Cookie Domain and Cookie Path to be blank and saved. I then uncommented those lines and tried again and all's working well!

like image 52
user223731 Avatar answered Oct 14 '22 08:10

user223731


In new Magento Installation, do the following ->

Open the file

app/code/core/Mage/Core/Model/Session/Abstract/Varien.php.

and change the code at line 87 to this ->

    $cookieParams = array(         'lifetime' => $cookie->getLifetime(),         'path'     => $cookie->getPath(),       //  'domain'   => $cookie->getConfigDomain(),       //  'secure'   => $cookie->isSecure(),       //  'httponly' => $cookie->getHttponly()     ); 
like image 43
Shashank Agarwal Avatar answered Oct 14 '22 08:10

Shashank Agarwal