Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't login to Magento admin

Tags:

admin

magento

I have magento installed in a subdirectory. www.domain.com/subdir/magento

This site worked perfectly at one point. I changed nothing, until my client said he couldn't login to magento admin.

I logged in just fine from my computer, but on his computer it just redirected back to the magento admin login without an error message and a url that looked goofy like this:

http://domain.com/subdir/magento/index.php/admin/index/index/key/3097210b826ac4a86d7531cb4089c9d0/

I thought that his cookies were being blocked, but that was not the case.

My magento settings were secure/unsecure baseurl: http://domain.com/subdir/magento/

web cookie path: (blank)
web cookie domain: (blank)

After clearing out var/cache, I found that I myself could not login to the admin either, with the same exact issue.

I tried the following settings without luck:

path: /
domain: domain.com

path: /subdir/magento
domain: vigrond.com

I also tried commenting out those lines in Varien.php, but that had no effect either.

My server account is a VPS and it has plenty of free space.

So I'm pretty much lost, wondering why this happened in the first place when it worked before (didn't change anything), and why it's so complicated?

Any help appreciated

like image 843
Vigrond Avatar asked Jan 31 '12 06:01

Vigrond


People also ask

What is the Magento admin login URL?

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

How can I find my Magento 2 admin 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.


1 Answers

I was fighting with this issue today on my local server. I couldn't login using any browser. I really didn't want to comment out any lines in core files or doing any other "dirty" solutions.

Firstly I checked cookie set by browser. It had expiration set to 1970, so clearly it was a cookie problem.

I checked values for cookies in magento database. In phpmyadmin I found table core_config_data, then fields with values : web/cookie/cookie_domain and web/cookie/cookie_path. They were both blank.

My solution was to set:

web/cookie/cookie_domain to my domain name

and

web/cookie/cookie_path to /.

Example:

your domain where you run magento is magento.local set:

web/cookie/cookie_domain = magento.local

and

web/cookie/cookie_path = /

like image 170
Protazy Avatar answered Sep 29 '22 14:09

Protazy