Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #cookie #expire #minutes
ADD COMMENT
Topic
Name
2+5 =