Google Chrome Logging Customers Out


Zen Cart isn’t the only platform having these issues with Chrome. The issue isn’t with your Zen Cart, but rather with Chrome.

Here is what happens when Chrome users, especially mobile users, are trying to shop on your Zen Cart but keep getting logged out.


Symptom: User adds something to cart, tries to login, checkout or any function on your Zen Cart requiring a session and the session fails.

Cause: Chrome’s Data Saver puts Google’s cloud servers between your website and the user. Data Saver (Web Light) attempts to compress the resources of the page before delivery to the end user. Just like Opera’s turbo feature and past IOS, you will see issues with recreating and maintaining sessions. It’s perfectly logical why you can’t and shouldn’t cache a session, it would be vulnerable to session hijacking and such. Since, Google Chrome enables this feature by default.

Fix: Since Google doesn’t see fit to warn users about this default Chrome setting, it’s up to us to protect the user as well as our sales. Luckily, it is an easy fix, all that is required is to send a Cache-Control: no-transform message on your site’s pages. You can read about it here.

Cache-Control is a HTTP header that defines the amount of time and manner a file is to be cached. This can be defined in your htaccess file. Example below:

<filesMatch “.(ico|gif|jpg|jpeg|png|flv|pdf|swf|mov|mp3|wmv|ppt)$”>
Header set Cache-Control “max-age=31536000, public”
</filesMatch>
<filesMatch “.(xml|txt|html|js|css)$”>
Header set Cache-Control “max-age=2628000, public”
</filesMatch>
<filesMatch “.(php|cgi|pl|htm|html)$”>
Header set Cache-Control “max-age=3600, public, no-transform”
</filesMatch>

You see we are ONLY limiting the transformation of file types which could require a session, static elements such as images can still be transformed for speed.

If you have an issue with this, your hosting company CAN HELP and set it for you.