Skip to content

Conversation

Debatty-Tom
Copy link
Contributor

Solve #5 by deleting all the cookies except the laravel-session and XSRF-token.

I tried to do it in JS, but after several attempts, I ended up doing it in the backend. Since it comes from the request, we don't need to make any wild guesses, contrary to what you feared.

foreach ($keys as $key) {
$response->withoutCookie(
cookie: $key,
domain: config('cookieconsent.cookie.domain'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this cope with cookies not related to the defined cookieconsent.cookie.domain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only manages cookies for the domain specified here. For subdomains, the only option would be to use JavaScript to loop through all possibilities, as we cannot obtain the domain with document.cookie, but is this the correct way to proceed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants