Magento Admin login problem
Problem:
I had a new installation of magento. But I was unable to login as an administrator. I went to the admin login page, entered correct username and password but was redirected to the same login page. I could not enter the dashboard page. Error message is displayed when I enter wrong username or password. But nothing is displayed and I am redirected to the same login page when I insert correct username and password.
Solution:
I googled and found these solutions:-
1) Use 127.0.0.1 instead of localhost in your url, i.e. using http://127.0.0.1/magento/index.php/admin instead of
http://localhost/magento/index.php/admin . But this didn’t solve my problem.
2) Since I am using Windows XP, I was suggested to open “host” file from
C:\WINDOWS\system32\drivers\etc and have 127.0.0.1 point to something like magento.localhost or even 127.0.0.1 point to http://www.localhost.com . But this also didn’t work either.
3) This solution finally helped me out of this problem. The solution was to modify the core Magento code. Open app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Comment out the lines 80 to 83. The line number may vary according to the Magento version. But these lines are present somewhere near line 80. You have to comment the comma (,) in line: $this->getCookie()->getPath()//,
// set session cookie params session_set_cookie_params( $this->getCookie()->getLifetime(), $this->getCookie()->getPath()//, //$this->getCookie()->getDomain(), //$this->getCookie()->isSecure(), //$this->getCookie()->getHttponly() );
Well, I am out of this problem. Hope, this solution you also help you.
Update (For Magento 1.4.*)
In Magento 1.4, you have to comment code from line 86 to 98 in app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Like this:-
/* if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}
if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
} */
From Mukesh Chapagain's Blog | Post Magento Admin login problem
It works!
But will it affect automatically updating magento in the future?
This might affect upgrading magento in future. Alternatively, at the time of installation, you can use ‘127.0.0.1′ instead of ‘localhost’.
If you have already installed magento, then you have to change some values in database.
Open core_config_data table of your magento database.
Edit the value with the path ‘web/unsecure/base_url’. Keep 127.0.0.1 instead of localhost.
Now, browse http://127.0.0.1/your_installation_folder
Thanks,
i am developing a b2b website in magento, but at first i want to make the login/registration page as the home page, how can i do this?
Thanks it really worked man ,
Great!, it works. Thanks!
thaks, great job
Didnt work for me. Now I get an error, I dont even get to the login page.
There has been an error processing your requestException printing is disabled by default for security reasons.
Error log record number: 882398834
I guess I am the only one!!, googled everywhere and no one else is having this problem.
Any ideas?
@trevor: Please recheck if you have commented the lines properly. There are 3 lines to be commented and a COMMA in the line above those 3 lines ($this->getCookie()->getPath()//,)
i have commented these line but then an another error occurs
There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 939170623
in my file code is
$cookieParams = array(
‘lifetime’ => $cookie->getLifetime(),
‘path’ => $cookie->getPath(),
‘domain’ => $cookie->getConfigDomain(),
’secure’ => $cookie->isSecure(),
‘httponly’ => $cookie->getHttponly()
Hi Mukul,
It seems that you are using Magento 1.4. There is some change in Varien.php code in Magento 1.4.
In Magento 1.4, you have to comment code from line 86 to 98. Like this:-
/* if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}
if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
} */
Hope this helps.
Thanks a lot for the solution!
Lot of Thanks for this solution!
Hi Mukesh and others,
Thanks for your help and work.
My new install is LIVE … on a server.
And I have same problem…. Can’t login. I did as instructed and commented out line 86-98 (it’s a fresh new 1.4.0.1 Magento)
First I thought it was something with my timezone (I picked “W Eastern Europe/Berlin” doing install (my timezone didn’t show?) that was the closest I could find… My timezone is Europe/Copenhagen … I edited the DB to this… (time is the same as Berlin))
Any ideas?
Or maybe a quick guide how to STRIP DB and start over?
“May the force be with you”
Master Yoda
Thank you! Thank you! Thank you!
I have spent hours trying to find a fix that actually works with Firefox. Your update for Magento 1.4 was the key.
Awesome, thanks!
Thanks sir
Hi Friend
Thanks for given the solution on the magneto admin login because finding solution from last two weeks end of day movement i got ur blog and solve my problem thanks for this once again
Rgds
Yogesh
Thanks a lot for the solution!
worked for me on 1.4
I have also same problem as other that is I am not able to login in the admin panel of magento after fresh installation.How to solve that problem if the IE7 says cookie not enabled in your browser.Please help me Mukesh.
@Kedar:
The easy way to enable cookies in IE 7 is as follows:-
- Open Internet Explorer.
- Click the menu.. Tools -> Internet Options.
- Click the Privacy tab.
- Move the slider down. And you will see the message Accept All Cookies. Then click OK.
Now, all cookies are enabled in your browser.
Hope this helps.
I have tried the above suggestions and still can’t get it to work. Can someone PLEASE help me login to my admin panel!!!
Hi Mukesh
I am new to magento and was baffled after installation……
Your hint helped me a lot….
Thanks a lot.
Regards,
Thanks,
This is the only solution that worked for me. Thank you so much!
Great, it works fine.
Many thanks
Thanks Mukesh,
It helped me.Now I am able to use magento freely now.Thanks again.
[...] The solution was to modify the core Magento code. Open app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Comment out the lines 80 to 83. The line number may vary according to the Magento version. But these lines are present somewhere near line 80. You have to comment the comma (,) in line: $this->getCookie()->getPath()//, [...]
Thanks a lot…this worked for me
Many thanks indeed Mukesh!
Cheers
Thank you Mukesh. It surely helped me a lot. I tried this earlier and then just because of that never tried it again. Found your fix via google and now will start checking Magento. Its hot.
[...] http://blog.chapagain.com.np/magento-admin-login-problem/ Evite gambiarras, faça de novo! Categories: Magento, PHP Tags: admin, login, magento, magento [...]
Hi
This is Maheswar Reddy,any how i solved my installation problem
after reading this article,Nice keep posting..
Thanks man.
I had the same problems with the following development configuration:
Windows 7
WampServer2.0i running with php 5.2.9.2 (instead of the default 5.3.0 )
Magento 1.4.0.1
your code “Update (For Magento 1.4.*)” fixed the problem.
Very nice work and thank you
It worked out after i tried 2 days. Thank you so much dear friend!!!
thanks mukesh…..it worked out for me also :)
Hi,mukesh i am facing some problem with fresh installed magento 1.4.0.1 ver it gives me bunch of JS errors after installing and integarting theme .Do you have any idea about this,problem…?Thanks in advance….
Hello Mukesh,
I meet same problem in Magento 1.4.1.0. I installed it on Ubuntu 8.04 and used xampp server 1.7.1. I have already comment out line 86 to 98 in app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. But after complete successful installation, i am unable to reach admin login page. Whenever i click ‘Go to Backend’ button from the final installation wizard page , it is redirected to Magento Home page; it can also redirected by clicking ‘Go to Frontend’ button from final installation wizard page.
Please help how can i make successfully login to admin page.
Thanks,
Eve
Thank you…
@Eve –
I suppose that you are installing magento in your local machine. Let us suppose that you have installed magento in a folder name ‘mymagento’. Then your backend (admin) URL will be
http://localhost/mymagento/index.php/admin
Hope this helps. Thanks.
Hi mukesh,
I had a new installation of magento. But I was unable to login as an administrator. I went to the admin login page, entered correct username and password but was redirected to the same login page. I could not enter the dashboard page. Error message is displayed when I enter wrong username or password. But nothing is displayed and I am redirected to the same login page when I insert correct username and password.
i have read your admin login problem article and i have again and again tried but the admin problem is not removing.
Please help how bec i want to access successfully login to admin page.
Regards,
Anuj03
That’s the only thing that worked out well for me, thanks dude. Btw, it is pretty annoying having to do such thing, when you know this bug was already there on previous versions of Mage, why didn’t they fix it?
How to add by default login/registration page in Magento ?
Hi
I face the same problems
Exception printing is disabled by default for security reasons.
Error log record number: 156018045810
i am not sure of the version though. i have tried both without much success. i have a doubt that i was working on 1.3 version and when i installed a new theme the installer got me a bunch of 1.4 files.
any assistance would be appreciated
Hi,
Great information on this problem. I tried the commenting out the nominated lines on the server:
In Magento 1.4, you have to comment code from line 86 to 98.
Did not work. What is of concern is that my test installation was working for a few weeks, I did not use for a few weeks and then could not log in to admin from two different computers. So it worked then did not work. What also does not work is the send password to email address.
This seems to be a BIG problem, locking out administrator on a live site would normally mean that is has been hacked and password reset. Works then stops is different from a bug which does not work from the start. How did the environment change to trigger this event?
Thanks very much for your information as it seems to be the only sane description of this problem
Thanks in advance
Very nice and helpful. Thanks………….
Thanks a lot for the solution! Nice one
worked for me on 1.4
thanks and it worked…
its a great thing installing magento..
I had to do lot of research to install it properly
thanks
Leave your response!
Donate
Help this blog grow!
Categories
Archives
Recent Tweets
Recommendations
Find me on Facebook
recent posts
most popular
tag cloud