Comments (6)
isConsentGiven
applies to all cookies and decline
only applies to optional cookies (could be named declineOptional
instead). Declining optional cookies still consents to required cookies, so isConsentGiven
is set to true.
declineAll
applies to required cookies aswell, so no consent is given in that case.
To make it more clear I think it would make sense for me to change the naming a bit.
So in summary:
- use
isConsentGiven
to check if cookies were given consent at all - use
cookiesEnabled
orcookiesEnabledIds
so check if the cookie you're interested in was given consent
from nuxt-cookie-control.
"use isConsentGiven to check if cookies were given consent at all"
This is ambiguous
isConsentGiven = true
means both:
- optional+necessary cookies were given consent ( by 'accept')
- only necessary cookies were given consent ( by 'decline' )
Yes, it is possible to distinguish by introduction of both
‘necessary' and ‘optional’ cookies but impossible without having ‘optional’ cookies. Documentation does not mention this feature.
from nuxt-cookie-control.
I don't really understand the answer. Is there anything you wish for? If so, please give a detailed specification ❤️
from nuxt-cookie-control.
i would like to react clearly on pressing each button.
Based on variables it is possible only by ‘watch’ a certain variable.
Which variable i have to watch to detect a pressed button:
‘accept’ ,
‘decline’,
'declineAll’,
‘acceptAll’
?
For example on ‘declineAll’ i have to break a session because the further operations are not allowed without necessary cookies. How can i catch pressing of ‘declineAll’ button if isConsentGiven==false before and after pressing the button ( so 'watch' does not catch this )?
from nuxt-cookie-control.
Currently, the ncc_c
is unset if the user has never made a decision and 0
if the user has previously given consent to any cookie. You could watch that cookie's value.
from nuxt-cookie-control.
Closing this as it seems reasonable to me to watch the enabled cookies. If you need button click events feel free to submit a PR! Should be fairly easy to implement 🙌
from nuxt-cookie-control.
Related Issues (20)
- missing useNuxtApp import in components HOT 2
- fix(component): cookie toggles do not show the correct state when `isIframeBlocked` is enabled HOT 1
- feat!: decline optional cookies, not all HOT 8
- Excessive stack depth comparing types 'NuxtModule<ModuleOptions>' and 'NuxtModule<ModuleOptions>'. HOT 6
- export statement in CookieControl component's <script setup> HOT 9
- Support package usage with Vite HOT 3
- implement "cookie" slot
- I want thai(th) languange HOT 2
- Modal creates a lot of Functional cookie toggles HOT 3
- The automated release is failing 🚨 HOT 7
- Types fail since [email protected]
- isConsentGiven still false after accept necessary is clicked HOT 1
- add support for lists in description HOT 13
- Cookie Links to route to page (using NuxtLink) HOT 3
- Modify cookie modal HOT 2
- Typed cookie id's HOT 7
- The automated release is failing 🚨
- feat: customizable cookie groups HOT 8
- Playground not building HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt-cookie-control.