cancel
Showing results for 
Search instead for 
Did you mean: 

Customers Cannot Add Products to Cart After Cookie Changes

Customers Cannot Add Products to Cart After Cookie Changes

This week, I was adjusting the Cookie Lifetime in our Magento 1.9 site. I also adjusted the session.cookie_lifetime values in the php.ini file (php version 5.6).

Cookie Lifetime (original value) = 259200
Cookie Lifetime (new value) = 1296000

session.cookie_lifetime (original value) = 0
session.cookie_lifetime(new value) = 86400

After those changes were implemented my sales team notified me that they couldn't place items in the Magento Cart. I quickly figured out that if the sales team cleared their browser cookies this issue was solved.

The next day, customers started calling in with this same issue - when they tried to add products to their shopping cart, they would see "shopping cart empty" and the product would never add to their cart. I also had customers who couldn't login to their accounts.

I reversed the Cookie Lifetime and session.cookie_lifetime values to their original values and cleared Magento Cache and reindexed the Magento site. The calls continued to come in. The only solution that I've been able to use to "fix" this is to have the user clear their browser cookies.

My problem is our customers are not very technical and walking them through this solution is often frustrating for the customer and they just hang up. I'm also not able to reach the customers who don't reach out to us for help.

Per the changes I made - what exactly caused this issue? It looks like there is some sort of cookie conflict happening. How do I go about getting this resolved for all customers so they don't have to contact us for help?

5 REPLIES 5

Re: Customers Cannot Add Products to Cart After Cookie Changes

If reverting it to the original value isn't working, it sounds like you may have to ride this one out as all the original cookies should expire after 72 hours.

Re: Customers Cannot Add Products to Cart After Cookie Changes

Unfortunately it has now been a week and our customers are still struggling with their carts.  We are looking at deleting our session files to clear out old data for our users.  If anyone has a better idea, I'm open to suggestion.

Re: Customers Cannot Add Products to Cart After Cookie Changes

Hello @jfeigal,

 

This issue come due to the cookie problem, not in browser but in Magento itself. 
As per default Magento, default cookie’s lifetime is set to 3600 (1 hour). But if the end users computer time runs ahead of server’s time, then cookies will not get set for magento frontend as well as backend. For example, end user’s computer time is 1 hour forward than server’s time, that means the cookie (holding user’s session id) will expire as soon as user logs in or tries to add an item.

 

To solve this issue, set cookie’s lifetime to 86400 (1 day) instead of 1 hour and everything will work as expected. You can also set cookie lifetime to 0, so that cookie will only expire when the user’s browser is closed.

 

Go to the admin panel: Sytem -> Configuration -> Web -> Session and Cookie Management Set cookie lifetime to 86400 and save. Functionality will work as expected.

If still you are facing the issue then check if there are two cookies are setting with same name: one for domainname.com and another for www.domainname.com. then need to change the cookie domain to www.domainname.com in Admin cookie settings, So that 2nd cookie disappeared and it will works as expected.

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Customers Cannot Add Products to Cart After Cookie Changes

I am having this exact same issue with my cart. I've tried solutions like this last reply, and many variations, to no avail.

 

Were you ever able to resolve this?

Re: Customers Cannot Add Products to Cart After Cookie Changes

Hi

 

I am facing same issue and I have done this Go to the admin panel: Sytem -> Configuration -> Web -> Session and Cookie Management Set cookie lifetime to 86400 and save. Functionality will work as expected.

 

 

Still not luck how did you fix it