Skip to content

Conversation

@tjmw
Copy link
Member

@tjmw tjmw commented Nov 7, 2025

What does this change?

This PR extends the expiration of all user benefits cookies to 30 days - GU_AF1, gu_allow_reject_all, gu_hide_support_messaging.

Why?

Previouly they were short lived (1-2 days) but this resulted in edge cases where if a signed-in user didn't visit the site for more than a couple of days, when they returned their first page view wouldn't reflect their benefits (i.e. they would see ads). This is due to a race condition between the user benefits refresh and ads code. However, we don't want to delay ads until after the user benefits have been refreshed as that would impact performance. So instead, extend the expiration of the cookie.

Note: this may result in a user getting benefits they no longer have on the first returning pageview, but this will be correct from the second page view onwards. We think this is OK.

This also means we now remove cookies if the user benefits response says they no longer have the benefit, rather than simply letting the cookie expire.

Note: this logic also exists in frontend and gateway, so needs to be updated in both those repos too.

Previouly they were short lived (1-2 days) but this resulted in edge
cases where if a signed in user didn't visit the site for more than a
couple of days, when they returned their first page view wouldn't reflect
their benefits (i.e. they would see ads). This is due to a race
condition between the user benefits refresh and the ads code. However,
we don't want to delay ads until after the user benefits have been
refreshed as that would impact performance. So instead, extend the
expiry of the cookie.

Note: this may result in a user getting benefits they no longer have on
the first returning pageview, but this will be correct from the second
page view onwards. We think this is OK.

This also means we now remove cookies if the user benefits response says
they no longer have the benefit, rather than simply letting the cookie
expire.
@tjmw tjmw changed the title WIP: Extend expiration of user benefits cookies to 30 days Extend expiration of user benefits cookies to 30 days Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants