Set cookies to expire in hours, minutes, seconds – Javascript

var date = new Date();
date.setTime(date.getTime()+(60*1000));
var expiry = ‘; expires=’ + date.toUTCString();
document.cookie = ‘ul=${fu}’+expiry+’; path=/’;

just change 60 to something else 60 sec =1 minute

Leave a Comment

Your email address will not be published. Required fields are marked *

Open chat