Skip to content

Add optional reject cookie support with explicit consent state#209

Closed
Numair25 wants to merge 2 commits intospatie:mainfrom
Numair25:main
Closed

Add optional reject cookie support with explicit consent state#209
Numair25 wants to merge 2 commits intospatie:mainfrom
Numair25:main

Conversation

@Numair25
Copy link
Copy Markdown
Contributor

This PR proposes adding support for a "Reject" option alongside the existing "Allow cookies" functionality.

It is based on a discussion opened here: #208

Summary of changes:

  • Adds a "Reject" button in the dialog
  • Stores consent state in the same cookie:
    • 1 = accepted
    • 0 = rejected
  • Treats both values as a decision, so the banner does not reappear
  • Maintains backward compatibility by continuing to rely on cookie existence

This allows developers to distinguish between accepted and rejected users and conditionally load scripts based on consent.

Happy to adjust or align with the package direction if needed.

@freekmurze
Copy link
Copy Markdown
Member

I'm going to keep the package a simple as possible for now.

@freekmurze freekmurze closed this Mar 27, 2026
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