Coder Social home page Coder Social logo

Comments (6)

dargmuesli avatar dargmuesli commented on September 15, 2024

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 or cookiesEnabledIds so check if the cookie you're interested in was given consent

from nuxt-cookie-control.

vladimir-pankov avatar vladimir-pankov commented on September 15, 2024

"use isConsentGiven to check if cookies were given consent at all"
This is ambiguous
isConsentGiven = true
means both:

  1. optional+necessary cookies were given consent ( by 'accept')
  2. 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.

dargmuesli avatar dargmuesli commented on September 15, 2024

I don't really understand the answer. Is there anything you wish for? If so, please give a detailed specification ❤️

from nuxt-cookie-control.

vladimir-pankov avatar vladimir-pankov commented on September 15, 2024

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.

dargmuesli avatar dargmuesli commented on September 15, 2024

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.

dargmuesli avatar dargmuesli commented on September 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.