Article
Get the user cookie, modify its age.
https://cdn.jsdelivr.net/npm/[email protected]/dist/js.cookie.min.js
Copy to clipboard
Suppose we want to modify the "age" value in the user cookie, we would accomplish this by writing: https://raw.githubusercontent.com/finsweet/jqueryCourse/main/cookies/ex13.js?actionable=true In the above example the user_cookie variable is an object and thus we can modify the age key before setting the cookie with the new modified object
<script>
$(document).ready(function(){
XT1
});
</script>
$(document).ready(function(){
XT1
});
</script>
Copy to clipboard
Live demo
<script>
$(document).ready(function() {
XT1
});
</script>
$(document).ready(function() {
XT1
});
</script>
Copy to clipboard
Press the Run Demo button to execute the scripts above.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.