Sucuri Docs > Website Firewall > Troubleshooting > Fixing PrestaShop Session Cache Issue

Fixing PrestaShop Session Cache Issue

As explained in "Session Cookies" of the 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?