Title: Bug Enable Session Tracking breaking cache
Last modified: July 7, 2026

---

# Bug Enable Session Tracking breaking cache

 *  Resolved [thomasjarvisdesign](https://wordpress.org/support/users/thomasjarvisdesign/)
 * (@thomasjarvisdesign)
 * [1 week ago](https://wordpress.org/support/topic/bug-enable-session-tracking-breaking-cache/)
 * We have a problem that appears to be caused by shop magic.
 * If I enable session tracking – It seems to stop wp-rocket cache from serving 
   consistently.
   (This is under shop Magic > Settings > General)
 * Can you confirm what enable session tracking does so I can troubleshoot further?
 * Note we are a paying Shop Magic customer.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbug-enable-session-tracking-breaking-cache%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [rzepsen](https://wordpress.org/support/users/rzepsen/)
 * (@rzepsen)
 * [6 days, 19 hours ago](https://wordpress.org/support/topic/bug-enable-session-tracking-breaking-cache/#post-18959210)
 * Hi [@thomasjarvisdesign](https://wordpress.org/support/users/thomasjarvisdesign/)
 * Thank you for reaching out.
 * We have investigated the behavior and confirmed that ShopMagic can set a cookie
   called `shopmagic_visitor_xyz`, which may affect how caching works. This is expected
   to some extent, as the cookie is used as part of ShopMagic’s visitor tracking
   mechanism.
 * The cookie is normally set when a visitor adds a product to the cart and starts
   providing checkout information. ShopMagic uses two mechanisms for tracking visitors:
    - WooCommerce session data
    - Browser cookies
 * Both methods are used because WooCommerce sessions are temporary and their data
   can expire relatively quickly, while cookies can persist for up to one year and
   allow more reliable visitor identification.
 * That said, while reviewing the code, we noticed that there may be a potential
   issue where the cookie is being set more frequently than necessary in some cases.
   We are looking into this further to confirm whether this behavior can be improved.
 * As a temporary workaround, you can disable cookie-based tracking while keeping
   session tracking enabled by adding the following filter:
 *     ```wp-block-code
       add_filter('shopmagic/core/customer_interceptor/cookies_enabled', '__return_false');
       ```
   
 * This will prevent ShopMagic from creating the visitor cookie, which should allow
   WP Rocket caching to work more consistently.
 * The alternative would be disabling session tracking entirely in ShopMagic settings,
   but we do not recommend this unless necessary, because it will prevent some functionality
   from working correctly, including abandoned cart tracking.
 * We will continue investigating whether there is a way to optimize this behavior
   on our side and will let you know if we find a better solution.
 *  Thread Starter [thomasjarvisdesign](https://wordpress.org/support/users/thomasjarvisdesign/)
 * (@thomasjarvisdesign)
 * [6 days, 18 hours ago](https://wordpress.org/support/topic/bug-enable-session-tracking-breaking-cache/#post-18959233)
 * Thank you for investigating.
 * To confirm if I add the snippet in your post to functions.php and then re-enable:
   “
   enable session tracking”(This is under shop Magic > Settings > General)It should
   prevent the cookie from generating and disrupting the cache.
 * **What kind of ETA for investigation are we looking at?**
   On larger websites 
   or sites with a high cache turnover (The kind that need shop magic) this is a
   huge problem.
 * WP-Rocket had been set to never clear cache on the site we are having the issue
   with – But the cache still wasnt being served. I would imagine a lot of your 
   clients will have the same cache bypass problem and not be aware of it!
 * This has been the main contributing factor to this site failing web vitals in
   real world data. As the TTFB score has plummeted due to bypass of page cache.
 * **To ensure the site runs fast all day we have the following running:**
    - WP-Rocket set to never clear unless instructed to
    - Clear the cache early morning
    - Run a private cache warmer on mobile and desktop useragents early morning
    - The site stays cached all day without breaking the wp_sessions_ which has 
      a lifespan of 48 hours.
 *  Plugin Support [rzepsen](https://wordpress.org/support/users/rzepsen/)
 * (@rzepsen)
 * [4 days, 19 hours ago](https://wordpress.org/support/topic/bug-enable-session-tracking-breaking-cache/#post-18961404)
 * Hi [@thomasjarvisdesign](https://wordpress.org/support/users/thomasjarvisdesign/)
 * Yes, that’s correct. If you add the provided snippet to your `functions.php` 
   file and then re-enable **“Enable session tracking”** in **ShopMagic → Settings
   → General**, it will prevent the cookie from being created and should no longer
   interfere with your page cache.
 * We will also investigate this behavior to determine whether it is caused by a
   bug. If we conclude that a fix is required, we’ll let you know once it has been
   implemented and released in a future update.
 * At the moment, I’m not able to provide a precise ETA for this investigation or
   a potential fix. We first need to address issues that were reported by other 
   customers before yours, so we handle bug reports according to our development
   queue.
 * Thank you for bringing this to our attention and for your patience.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbug-enable-session-tracking-breaking-cache%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/shopmagic-abandoned-carts/assets/icon-256x256.png?rev=3434207)
 * [ShopMagic Abandoned Cart Recovery for WooCommerce](https://wordpress.org/plugins/shopmagic-abandoned-carts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shopmagic-abandoned-carts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shopmagic-abandoned-carts/)
 * [Active Topics](https://wordpress.org/support/plugin/shopmagic-abandoned-carts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shopmagic-abandoned-carts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shopmagic-abandoned-carts/reviews/)

## Tags

 * [abandon cart](https://wordpress.org/support/topic-tag/abandon-cart/)
 * [caching](https://wordpress.org/support/topic-tag/caching/)

 * 4 replies
 * 2 participants
 * Last reply from: [rzepsen](https://wordpress.org/support/users/rzepsen/)
 * Last activity: [4 days, 19 hours ago](https://wordpress.org/support/topic/bug-enable-session-tracking-breaking-cache/#post-18961404)
 * Status: resolved