Wednesday, 10 October 2012

Magento: can't login to admin panel, can't add product to cart

If ever you encountered issues like you cannot login to the admin panel or cannot even add product to the cart, I have a better solution for you.

Using phpMyAdmin, in your magento database, look for the core_config_data table and click it. Click the "Search" tab.  Then on the "path" column set the operator to LIKE %...% and the Value to cookie and click the "Go" button to search.


Screenshot provided for clarity

After searching, set the value of web/cookie/cookie_pathweb/cookie/cookie_domainweb/cookie/cookie_httponly, and web/browser_capabilities/cookies to NULL

Just like this on the screenshot.
Screenshot provided for clarity

Adding product to cart and logging in to the admin panel should work now!






12 comments:

  1. Thanks for this!
    Save me hours of trouble!
    i've noticed this problem on all my magento installations on a local server.
    is there a way to fix this without changing the database?

    Cheers mate!

    ReplyDelete
    Replies
    1. So far it's the best approach rather than editing the core file

      Delete
  2. Whaaat? it's not working on my side. Are you sure Gen Nerdito?

    ReplyDelete
  3. Thanks man! That was an elegant solution.

    ReplyDelete
    Replies
    1. No worries. Glad it worked on your end :)

      Delete
  4. neither for me... any other solution?

    ReplyDelete
  5. Spot on, many thanks.
    For those having trouble, clear out var/session & var/cache after these steps, worked for me after that.

    ReplyDelete
    Replies
    1. Cool! Glad it worked on your end mate. Cheera

      Delete
  6. Thank you so much for this info... I am not sure why I suddenly have this issue, but changing these fields fixed my Shopping Cart is Empty issue. I still cannot login to the backend however. The page just refreshes and adds "/index/index/key/77089e19c1f4cdae2daab32995fc8122/" to the url. Do you have any idea what this means? Thanks!

    ReplyDelete
  7. Hi my magento 2.0.5 ce install does not have the cookie lines in the core_config_dat table but I know when I configured magento I chose the use https option now I can't access the admin panel. Do you have any other suggestions? Thanks

    ReplyDelete