After installing magento can’t log in to admin panel
Problem Description
While installing magento on xampp version 2.5 you have provided admin username and password. After installation finished you no longer login with your admin account. In fact in the “Log in to Admin Panel” window whenever you provide wrong password/username combination it displays “Invalid Username or Password.” But whenever you provide correct password it does not show anything. Though a new url like
http://127.0.0.1/magento/index.php/admin/index/index/key/d135be4de664ab83db829120740e058a/
is displayed on the address bar.
Everytime you do this you can’t log in to admin panel.
Cause of the problem
The problem occurs because magneto could not store cookies. We run it as localhost and localhost is not true domain but to store cookies we need a domain. That’s why login stops without saying any word.
Solution of the problem
Way 1:
In different forums I saw they mentioned connecting as http://localhost/magento/index.php/admin will fail but if you connect as http://127.0.0.1/magento/index.php/admin it will work. But in my case IP address in the URL did not work too.
I made it work into whenever I changed my browser. Suppose I installed magento using google chrome browser and I open admin url into my firefox window and it worked. Though in the firefox the url http://localhost/magento/index.php/admin did not work, but url http://127.0.0.1/magento/index.php/admin worked fine.
Way 2:
-Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.
-Find the code,
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath(),
$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()
);
-Replace above code by,
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);
-Save it and try to login to your magento admin panel.
It would work.
Related posts:

hello
the only solution that works
10q
if u only comment the lines instead of replacing text take a good look at commas
Hello,
The second way works perfectly.
The server is windows server 2003 and Xampp.
Thanks you.
hey thankx
way – 1 st is work for me.
i log into admin pannel with IE using loopback address
thankx
Thanks! This was very helpful.
Hey Thanx.
It’s work.
Thank you for topic.
Solution 2 is right. There’s only one piece of code block to temporarily disable in one of Magento’s Core files. Found this blog that tells the same remarkable solution. http://markuzweb.blogspot.com/2009/08/cant-login-to-magento-admin-panel-after.html
Great !! many thanks
Great help. Second method works perfectly.
Thank you veryyyyyyyyyyyyyyyy much…
You saved me from panic!!!
Hi
Thank you very much. Its working very nicely. After login using with ip address, base url warning is coming. If we are changing that value in configuration part, its working perfectly.
thanks
Saran
Great work
Thank you
hey thanx….it was really helpful…
It’s really a valuable post….!!thanks…(I enjoy the benefit of Ur post)!!!
Way 2 worked for me, thanks!
Hi,
Thank you very much!
It works for me.
Thanks again!
San.
Have seen these two solutions on lotsa blog… both didn’t work for me…
(
any othe solution pls ?
rgs
Manish
i get error
Parse error: parse error in C:\wamp\www\magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php on line 84
any one can help me?
i have this code in app\code\core\Mage\Core\Model\Session\Abstract\Varien.php in this file
$cookieParams = array(
‘lifetime’ => $cookie->getLifetime(),
‘path’ => $cookie->getPath(),
‘domain’ => $cookie->getConfigDomain(),
’secure’ => $cookie->isSecure(),
‘httponly’ => $cookie->getHttponly()
);but when i comment 3 line then i got error given below
http://localhost/magento/admin
Error log record number: 1663895226
can any one help me
I worked all the solutions provided for this error
I would suggest if none of the codes works for u than try this one
it worked for me..
None of the above..
In fact, in version 1.4.0.1 you can comment only the line #100 ( call_user_func_array(’session_set_cookie_params’, $cookieParams); ) and it will work
Try this:
http://mysillypointofview.wordpress.com/2010/03/24/how-to-fix-magentos-admin-login-failing-no-error-message-on-localhost/
Hi,
Note that when you comment 3 lines, you also need to removed character , on the line ‘path’ => $cookie->getPath(),
This is really must be $cookieParams = array(
‘lifetime’ => $cookie->getLifetime(),
‘path’ => $cookie->getPath()
//‘domain’ => $cookie->getConfigDomain(),
//’secure’ => $cookie->isSecure(),
//‘httponly’ => $cookie->getHttponly()
);
Hope that it works for you
Thanx to all my admin Panel is working now
Thanks to Kajal above, commenting line 100 worked, that was an easy fix that only took a few hours to figure out.
Thanks Varien for the great local install instructions on windows 
I will try Richard’s too which seems quite comprehensive, but for a quick fix Kajal worked.
Now to figure out this pesky index.php url rewriting issue now that I can log in. Boy talk about out of the box turn key. Maybe they shoudl package up a developer local install instead of having to work all this out via forums.
Cheers Guys.
@kajal was abt to give up then i saw ur post thankx a million , commenting out line #100 worked for me too ,
I think you have to comment this this line
//call_user_func_array(\’session_set_cookie_params\’, $cookieParams);
Hi there,
I am using this simple procedure under Windows7:
1. install XAMPP and enable \"iconv\"
2. edit the file \"hosts\" to this: 127.0.0.1 localhost.com
3. copy the magento files to the directory: C:\\xampp\\htdcs\\magento\\
4. start the Apache and MySQL
5. Go to the address: http://localhost.com/magento
6. Follow the installation wizard.
7. Now You will be able login to the administration.
ENJOY!
=D
Leave your response!
Quick Quote & Support
Latest Project
Categories
Magento Links
Recent Posts
Our Partners
Popular Tags
Recent Comments
Most Popular Posts
Testimonials
AREIL Field Services, Inc