question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update cookie value

See original GitHub issue

Hello!

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Mastermindzhcommented, Sep 17, 2021

6.4.0 has been released 😄

Thanks for the contribution!

0reactions
Mastermindzhcommented, Sep 10, 2021

main branch please 😃 i’ve dropped the hooks branch for now, but I’ll pick it up eventually 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found