-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix global bar multiple cookies #2026
Conversation
1005202
to
75980f2
Compare
(sorry, still need to test on various frontend apps in integration. Will invite for review once I've done more testing) |
We had an issue where the global bar was setting 2 global_bar_seen cookies on some pages. The initialise logic was setting a cookie with the path of the page, whereas other logic was using GOVUK.setCookie() which sets with a path of "/". This commit switches the initialise logic to use GOVUK.setCookie() too, so the path is the same and we only have one cookie.
75980f2
to
e739f44
Compare
Ready for review now - seems to fix the issue when I tested on integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much easier to follow the new code – and less cryptic. Thanks for fixing this so quickly!
We had a bug which meant that the global_bar_seen cookie was sometimes set more than once. This bug has now been fixed (#2026), but some users will be left with these duplicate cookies and therefore will continue to see the issue. This commit introduces a function that checks for these duplicate cookies and deletes them if they're present.
We had a bug which meant that the global_bar_seen cookie was sometimes set more than once. This bug has now been fixed (#2026), but some users will be left with these duplicate cookies and therefore will continue to see the issue. This commit introduces a function that checks for these duplicate cookies and deletes them if they're present.
We had a bug which meant that the global_bar_seen cookie was sometimes set more than once. This bug has now been fixed (#2026), but some users will be left with these duplicate cookies and therefore will continue to see the issue. This commit introduces a function that checks for these duplicate cookies and deletes them if they're present.
We had a bug which meant that the global_bar_seen cookie was sometimes set more than once. This bug has now been fixed (#2026), but some users will be left with these duplicate cookies and therefore will continue to see the issue. This commit introduces a function that checks for these duplicate cookies and deletes them if they're present.
Trello: https://trello.com/c/hA65u9qV/460-global-banner-setting-two-cookies-on-some-pages
What
Use cookie helper functions in the global bar init logic, to match the rest of the global bar logic.
Why
The global banner was setting two cookies on some pages, one with a path of '/' and one with the path of the page. This had the side effect of the banner not being able to be dismissed (it also didn't disappear after 3 page views). This looked like it was happening because some of the global bar functions set the cookie manually without specifying a path, whereas other functions use the cookie helper function which always set the path to '/'.
Example page to check:
www.gov.uk/government/organisations/companies-house