Can’t login to magento admin after installation.

If the domain is not a true domain then this problem occurs. Its like if you use your localhost to run magento store,then you will face this problem.

You can overcome this by browsing using ur ip address or you can remove these three line from the following page.

app\code\core\Mage\Core\Model\Session\Abstract\varien.php

$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()

Comment these lines  line (may be at line 78…);

Hope magento admin will work now on your localhost with the following url. :)

http://localhost/magento/admin/

Just try out and play with your stores……

56 Responses to this post.

  1. Posted by Gyan on June 4, 2009 at 12:02 pm

    Hey thanks, have been struggling these two days to get the solution. It finally worked! cheers

    Reply

  2. Posted by sasi kumar.c on June 5, 2009 at 10:59 am

    HI milansaha,

    Thanks a lot buddy.. its working now… i hv struggled past 3 days in this problem.. feel very happy..

    Thank u so much

    Reply

  3. Hi….
    thank you so much…..

    Reply

  4. Posted by Kilroy on July 6, 2009 at 2:42 pm

    Thanks a bunch.
    It now works correctly (though it is slow as hell locally)

    This should really be mentioned in guides on how to install Magento on Wampserver

    Reply

  5. Posted by vlad on July 8, 2009 at 2:26 pm

    You are the man!

    Reply

  6. Posted by Nasir on July 11, 2009 at 3:41 am

    Thanks a lot to give me my login problem sonve. 12 hours trying

    Reply

  7. Posted by milansaha on July 11, 2009 at 5:15 am

    Hello…all of u are welcome !

    @ nasir….u can leave your queries here and i will reply you.
    You can also reach me : milan.saha@gmail.com

    Reply

  8. Posted by Jeremy on July 18, 2009 at 7:10 pm

    Hey, thanks for this. I found safari worked fine with no modification, but firefox would not work without altering the session_set_cookie_params as suggested.

    In 1.3.2.2 I had to comment all lines of those params from line 77 to 84. If I comment just the (3) suggested I got a blank screen. Just a heads up.

    Thanks for adding to the community. I am new to this so you are my saving grace.

    Reply

  9. Ok, In 1.3.2.2 I had just comment out those three lines that you have told me and it’s worked for me. Thanks for your suggestion. Oh, by the way I am using xampp, Windows XP

    Reply

  10. thank youy very much for your nice & working solution.

    simply a awosome solution.

    again thanks a lot.

    Reply

  11. Posted by Aurelio on July 28, 2009 at 6:52 am

    Thanks, I tried to replace localhost by 127.0.0.1 and it’s now working.

    I just installed: 1.3.2.3 in WAMP and if you change the locahost “name” then you will be able to log in Admin Zone.

    Reply

    • Posted by milansaha on July 31, 2009 at 11:45 am

      Yes…that is also possible because the default IP to browse the apache server on a localhost.

      Reply

  12. Many thanks…!!!

    Reply

  13. Posted by Tushar on August 4, 2009 at 5:54 pm

    Thankx Man

    It works

    Reply

  14. Posted by Vinny on August 6, 2009 at 8:23 am

    Thanks a lot milansaha !! Its saved my time.. ;) Many tanks !

    Reply

  15. Posted by csemrm on August 11, 2009 at 3:57 pm

    if i this 3 line off then ,the following error shown

    “There has been an error processing your request.”

    Reply

  16. Posted by thabetinfo on August 14, 2009 at 8:54 am

    thankssssssss

    Reply

  17. Posted by csemrm on August 15, 2009 at 1:40 pm

    Hello brother
    I got another solution for installation in local PC and access admin panel.
    For access admin panel only replace
    http://localhost/magento ->http://192.168.0.1[Local IP]/magento .

    thanks

    Reply

  18. Posted by Backus on August 16, 2009 at 6:57 am

    Fucking a, thank you so much, what a stupid bug.

    Reply

  19. Posted by Jez on August 26, 2009 at 9:08 pm

    Thanks… had me stumped for ages!

    Reply

  20. Posted by Rojan John v on September 8, 2009 at 7:41 am

    HI milansaha,

    Thanks a lot….. its working now… i hv struggled 2 hours in this problem.. feel very happy..keep in touch

    Thank u so much

    Reply

  21. Posted by Rojan John v on September 8, 2009 at 7:46 am

    {{base_url}} is not recommended to use in a production environment to declare the Base Unsecure Url / Base Secure Url. It is highly recommended to change this value in your Magento configuration.

    What will do ?

    Reply

    • If you are working on a true hosting i.e. if you have a domain name(www.abc.com) for your site then you just enter that url in this field instead of {{base_url}} .
      Thats it.

      Reply

  22. Posted by Saswata on September 9, 2009 at 6:39 am

    Thank u very very much.It works finally.It saves me lots of headache.

    Reply

  23. Posted by Sheeba on September 16, 2009 at 8:29 am

    Thank you very much…..Are u from the magento team?

    Reply

  24. Posted by evoratec on September 16, 2009 at 8:37 am

    Thanks a lot, man.

    Reply

  25. Posted by Sheeba on September 16, 2009 at 10:58 am

    hi,one more help is needed.
    When we add new files/modules in magento,it is not detecting the changes.How to overcome this problem.

    Reply

  26. Posted by Raju on September 18, 2009 at 7:23 pm

    hi.. great man… simply super…

    Reply

  27. Posted by Raju on September 18, 2009 at 7:30 pm

    one more help milan..
    how can i integrate hellopod themes..
    here i downloaded full version of hellopod themes..
    they gave instruction also..
    regards that instruction we need to replace app and skin folders within the root folder..
    i replaced that folder.. but it showing error to me..
    can u help me pls

    Reply

    • Posted by Milan on September 18, 2009 at 7:55 pm

      I guess it should work if you place the files properly.
      Then you have to write the theme name form admin area for your store to see in action.
      If you still face problems then i think there are problems with the xml file for the theme to make the proper template structure in magento layout.

      Reply

  28. Posted by Kulk on September 19, 2009 at 12:56 am

    Thanks my friend

    Reply

  29. Thanks man, i battled with this stuff for 2days.

    Reply

  30. Posted by Yogesh on October 8, 2009 at 8:23 am

    Hey, Thanks a lot, I tried it by setting a enter 127.0.0.1 http://www.localhost.com it also works but if you click on any link it automatically redirects to http://localhost/magento instead of http://www.localhost.com/magento.
    But your solution is perfect

    Reply

  31. Posted by Yogesh on October 8, 2009 at 8:33 am

    Hi, I have one problem, I need to integrate Indian payment gateway (times of money) in Magento. could you please guide me in how to create module for this? or please tell me where I can find the files of authorized or paypals payment gateway file it may help me to create new module.

    Reply

  32. Thanks for you tips. Its very useful for new user.

    Reply

  33. Posted by supunmali on October 15, 2009 at 3:35 am

    Really useful. :)

    Reply

  34. Posted by supunmali on October 15, 2009 at 4:32 am

    I am havin this issue, that I did add the modern theme. But now i cannot change back to default theme, i did get when I first installed magento. How can I get it? Even I cannot change to another theme. It gives errors in the front end view.

    Why is it? I did change Default in Design to default get the default theme. (For modern theme I changed it to Modern) after adding the extension.

    Reply

    • Posted by milansaha on October 16, 2009 at 3:33 pm

      I guess the problem may occur due to improper configuration from the admin area or for any other error in the page.xml file.Firstly you need to make sure that you placed all the files for the new theme in the proper directories and then you have to enter the theme name from the admin area.

      Thats it. Your theme should be in action. :)

      Reply

      • Posted by supunmali on October 21, 2009 at 6:57 am

        Thanks a lot.. It worked.. had to change the page setup and after deleting the cache it worked. :)

  35. Good one, this fixed the issue in a jiffy

    These are precisely the lines one needs to comment in the file varien.php (the ones starting with // are commented). Also remember to take out the comma from the end of the line $this->getCookie()->getPath()

    session_set_cookie_params(
    $this->getCookie()->getLifetime(),
    $this->getCookie()->getPath()
    //$this->getCookie()->getDomain(),
    //$this->getCookie()->isSecure(),
    //$this->getCookie()->getHttponly()
    );

    Thanks

    Reply

  36. Posted by Abdelkarim on October 26, 2009 at 10:30 pm

    Wow its work
    thanks alot ;)

    Reply

  37. Posted by phpini on November 13, 2009 at 6:55 am

    thanks lot :D

    Reply

  38. Posted by George on November 19, 2009 at 3:08 pm

    My setup stop working after configuration page. I can not get to “Create Admin account” page.
    Last url in browser:
    http://127.0.0.1/index.php/install/wizard/configPost/
    The error is:
    HTTP 500 Internal server error

    Any ideas?
    George

    Reply

  39. Posted by Arun on November 20, 2009 at 6:50 am

    Hi,
    Many thanks for this. Now its working fine. Just a warning, which tells about base_url. But this doesn’t seems to be a problem. Need to take care of this if I’m moving to production mode. Now I’m just setting it up locally.

    many thanks :-)

    Regards,
    Arun Suresh.

    Reply

  40. Posted by Aster on November 20, 2009 at 10:50 am

    Go check this site for a detailed version of this article. http://markuzweb.blogspot.com/2009/08/cant-login-to-magento-admin-panel-after.html <– This blog contains a mouthful of tips which comes very handy as well.

    Reply

  41. Thanks a lot, it works fine!

    Reply

Respond to this post