How to set this cookie to expire in one hour from the current time:
document.cookie = \'username=\' + value; + \'expires=\' + WHAT GOES HERE?; + \'path = /\'
Code :
var now = new Date(); var time = now.getTime(); time += 3600 * 1000; now.setTime(time); document.cookie = 'username=' + value + '; expires=' + now.toUTCString() + '; path=/';