Commit b1c2335
authored
Extend expiration of user benefits cookies to 30 days (#14810)
This PR extends the expiration of all user benefits cookies to 30 days -
GU_AF1, gu_allow_reject_all, gu_hide_support_messaging. The
gu_user_benefits_expiry cookie continues to have an expiry of 1 day, so we'll
recheck every day while the user is signed in.
Previously 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 has been updated in
both those repos too:
guardian/frontend#28352
guardian/gateway#32851 parent da75f6c commit b1c2335
1 file changed
+40
-8
lines changedLines changed: 40 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
51 | 68 | | |
52 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
53 | 75 | | |
| 76 | + | |
54 | 77 | | |
55 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
56 | 84 | | |
57 | | - | |
58 | | - | |
| 85 | + | |
59 | 86 | | |
60 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
61 | 93 | | |
62 | 94 | | |
63 | 95 | | |
| |||
0 commit comments