Answers for "javascript cookie expire in 5 minutes"

0

javascript cookie expire in 5 minutes

function createCookie(name,value,minutes) {
    if (minutes) {
        var date = new Date();
        date.setTime(date.getTime()+(minutes*60*1000));
        var expires = "; expires="+date.toGMTString();
    } else {
        var expires = "";
    }
    document.cookie = name+"="+value+expires+"; path=/";
}

createCookie("name", "value", 5)
Posted by: Guest on September-24-2021

Code answers related to "javascript cookie expire in 5 minutes"

Code answers related to "Javascript"

Browse Popular Code Answers by Language