1. Home
  2. Docs
  3. Website Firewall
  4. Troubleshooting
  5. Fixing PrestaShop Session Cache Issue

Fixing PrestaShop Session Cache Issue

As explained on item "Session Cookies" of Troubleshoot Cache Issues article, you must set the Cache Level to "Site Caching" and add the following code to your .htaccess file:

# BEGIN Prevent Session Cookie Cache
    <ifModule mod_headers.c>
        Header append Vary "Cookie"
    </ifModule>
# END Prevent Session Cookie Cache

Or you could add the following code to your index.php, but be sure to confirm with your developer this won’t break your application:

// Prevent browsers and CDNs page caching.
header('Vary: Cookie');
header('Cache-Control: no-store, no-cache, must-revalidate');

For NGINX or IIS servers, you should speak with your hosting provider to convert those .htaccess lines to NGINX or IIS rules.

Was this article helpful to you?