pull down to refresh

25k sats + lifetime Gold membership on SATOSH.EE and my eternal gratitude to whoever helps me solve the issue (did not set up a bounty here since I'll be posting this also on nostr and X).
I’m running into an issue with referral links on a WooCommerce site (WordPress + WooRewards paid version + Referral Codes (WooRewards and Referral Codes are LongWatchStudio plugins); also tested with the Affiliates plugin - the issue also occurred with that one). The goal is to establish referral bonds between users for a loyalty/affiliate program.
The problem:
  • Referral logic only triggers on the second visit to a referral URL.
  • On first visit, cookies for tracking (e.g., lwsadmsession…) either don’t appear or the plugin code never runs.
  • Reloading the same link triggers the referral logic as expected.
  • This behavior occurs with multiple referral plugins, not just WooRewards.
What I’ve tried:
  • Disabled all other plugins, switched to default theme
  • Cloudflare + Rocket.net: disabled query string caching
  • .htaccess rules to bypass server caching
  • Early hook code to force session/logic execution (relied on ChatGPT to come up with those codes, would not be surprised if they were faulty in and of themselves)
  • Verified no Varnish or server-level caching interference
Developer insight from WooRewards: “Our code is never called. Something else takes charge before WordPress, and (even if unintentional) fakes our redirection.”
Looking for ideas why referral plugin code isn’t executing on first visit, even when cookies or sessions should be available.
Happy to provide more details, just drop a comment or email me kontext@satosh.ee
Thanks!
0 sats \ 3 replies \ @ek 27 Aug
  • On first visit, cookies for tracking (e.g., lwsadmsession…) either don’t appear or the plugin code never runs.
  • Reloading the same link triggers the referral logic as expected.
Does the referral logic depend on cookies present? Are your cookies using SameSite=Lax?
Is there a way for us to reproduce the issue?
reply
  • On first visit, cookies for tracking (e.g., lwsadmsession…) either don’t appear or the plugin code never runs.
  • Reloading the same link triggers the referral logic as expected.
Does the referral logic depend on cookies present? Are your cookies using SameSite=Lax?
Is there a way for us to reproduce the issue?
The SameSite column is empty on all cookies, so from what I understand: Blank SameSite = defaults to SameSite=Lax
I recently launched another website and installed the Referral Codes plugin again to test the behavior. The same issue persists. Initially I was certain that the issue was related to the LongWatchStudio plugins themselves, so I was in a lengthy correspondence with them, they claimed they weren't able to reproduce the issue on their end. I am thinking of emailing them again due to the fact that the same problem is present on a new site, but nevertheless, the fact that another plugin behaved the same way (at least on the older site, haven't tested on the new one yet), seems to indicate that it's not just a plugin issue.
The way the referral codes work does not seem to be dependent on whether the cookies are present from the get-go or not. I tested this yesterday:
On the new site, the plugin's cookie lwsadmsession... was present on the first visit, however the referral logic didn't trigger until the 2nd visit.
On the older site, the cookie wasn't present on the first visit, referral logic acted the same (only triggered on the 2nd visit)
reply
10 sats \ 1 reply \ @ek 27 Aug
The SameSite column is empty on all cookies, so from what I understand: Blank SameSite = defaults to SameSite=Lax
This depends on the browser, see 'default to Lax' row here.
Did your referrals work before?
reply
The referrals worked at some point when the original site (satosh.ee) was a WIP... can't tell you the exact time when I tested the system, but based on my notes it seems initial tests were done already back in October 2023. But by the time I launched it, more than a year later in November 2024, the links weren't working properly and I haven't gotten them to work since.
reply