I need to be able to set a cookie and have it expire every saturday using Javascript but not sure where to begin.
var now = new Date(); var day = now.getDay();
document.cookie =
I need to be able to set a cookie and have it expire every saturday using Javascript but not sure where to begin.
var now = new Date(); var day = now.getDay();
document.cookie =
Copyright © 2021 Jogjafile Inc.
First you have to define next Saturday this way.
if you
console.log(nextSaturday)
it will give you the date of next Saturday. Then you can store your cookie like this: