Update cookie value
See original GitHub issueHello!
I am building a NextJS website and I am using react-cookie-consent to ask the user to accept/deny cookies. It works great!
As a new requirement I want to build a page where I allow the user to update their consent (accept/deny “toggle”). So I started to look at how to achieve that.
I could obviously grab the js-cookie const (import { Cookies } from 'react-cookie-consent') grab the cookie and update the value. At the same time I was wondering whether it would be an idea to extend react-cookie-consent with that function (I can at least try to provide you with a PR for that)?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How to Set Cookie and Update Cookie with JavaScript - Tabnine
To update a cookie, simply overwrite its value in the cookie object. You do this by setting a new cookie on the document...
Read more >How to update and delete a cookie? - javascript - Stack Overflow
I need help to know how to update values and how to delete a cookie created from this code! I'm new to JavaScript...
Read more >Document.cookie - Web APIs | MDN
In the code above, newCookie is a string of form key=value . Note that you can only set/update a single cookie at a...
Read more >JavaScript Cookies - W3Schools
Change a Cookie with JavaScript ... With JavaScript, you can change a cookie the same way as you create it: document.cookie = "username=John...
Read more >How To Create, Read, Update, & Delete Cookies In JavaScript
Update Cookies. You can change a cookie the same way you create them by overwriting it with a new value. You could use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

6.4.0 has been released 😄
Thanks for the contribution!
main branch please 😃 i’ve dropped the hooks branch for now, but I’ll pick it up eventually 😃