Skip to content
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 cookies not deleting on opt-out #5338

Merged
merged 31 commits into from
Oct 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e6183c6
update removeCookiesFromBrowser
jpople Sep 27, 2024
2f68cc8
update cookie deletion
jpople Sep 30, 2024
d94c5fb
update Jest test
jpople Sep 30, 2024
87fbe96
add tests for explicitly configured domains
jpople Sep 30, 2024
7135193
remove console logs
jpople Sep 30, 2024
bdcbbf9
Merge branch 'main' into jpople/prod-2822/cookie-deletion-bug
jpople Sep 30, 2024
65490af
update with env var to determine whether subdomain cookies are deleted
jpople Oct 3, 2024
708c7b6
fides-js changes
jpople Oct 3, 2024
3954aea
Merge branch 'main' into jpople/prod-2822/cookie-deletion-bug
jpople Oct 3, 2024
fe51336
remove debug log
jpople Oct 3, 2024
09bffef
reapply test changes
jpople Oct 3, 2024
6d68bbd
rename 'delete notice cookies on opt out' to 'automatic subdomain coo…
jpople Oct 3, 2024
6c9a51d
revert cookie delete logic
jpople Oct 3, 2024
1e59c17
add comment with link to followup
jpople Oct 3, 2024
e9eb6ac
Merge branch 'main' into jpople/prod-2822/cookie-deletion-bug
jpople Oct 3, 2024
aa28ea2
adjust strategy to use bool flag on experience configs, create migrat…
eastandwestwind Oct 8, 2024
397c22e
format
eastandwestwind Oct 8, 2024
124db46
format
eastandwestwind Oct 8, 2024
8c2d58a
lint, update tests with explicit bool vals
eastandwestwind Oct 8, 2024
867b741
fix test
eastandwestwind Oct 8, 2024
b58c815
Merge branch 'main' of github.com:ethyca/fides into jpople/prod-2822/…
eastandwestwind Oct 8, 2024
e6e8a13
missed table in migration
eastandwestwind Oct 8, 2024
7b2dcbd
Merge branch 'main' of github.com:ethyca/fides into jpople/prod-2822/…
eastandwestwind Oct 8, 2024
4a95e01
fix form field
eastandwestwind Oct 9, 2024
67eba3b
Merge branch 'main' of github.com:ethyca/fides into jpople/prod-2822/…
eastandwestwind Oct 14, 2024
a18d4df
adds tooltip
eastandwestwind Oct 14, 2024
e2e8355
bump downrev
eastandwestwind Oct 14, 2024
6abd382
update migration
eastandwestwind Oct 16, 2024
6a697fb
Merge branch 'main' of github.com:ethyca/fides into jpople/prod-2822/…
eastandwestwind Oct 16, 2024
91c2f73
bump downrev
eastandwestwind Oct 16, 2024
dadabee
rebase
eastandwestwind Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions clients/fides-js/src/lib/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,15 @@ export const makeConsentDefaultsLegacy = (

/**
* Given a list of cookies, deletes them from the browser
* This only removes cookies from the current domain and subdomains
*/
export const removeCookiesFromBrowser = (cookiesToRemove: CookiesType[]) => {
cookiesToRemove.forEach((cookie) => {
cookies.remove(cookie.name, {
path: cookie.path ?? "/",
domain: cookie.domain,
});
const { hostname } = window.location;
const domainToRemove = cookie.domain ?? hostname;
const pathToRemove = cookie.path ?? "/";
document.cookie = `${cookie.name}=; path=${pathToRemove}; domain=${domainToRemove}; expires=Thu, 01 Jan 1970 00:00:01 GMT`;
document.cookie = `${cookie.name}=; path=${pathToRemove}; domain=.${domainToRemove}; expires=Thu, 01 Jan 1970 00:00:01 GMT`;
});
};

Expand Down
Loading