Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript check if array has duplicate values 
Javascript :: send data from one page to another html page in Javascript 
Javascript :: jquery siblings 
Javascript :: js convert special characters to html entities 
Javascript :: react fetch url 
Javascript :: javascript if has jquery loaded 
Javascript :: Reading Time with jquery 
Javascript :: javascript get nth element of array 
Javascript :: File type node js 
Javascript :: button in javascript 
Javascript :: $.post jquery beforesend loader 
Javascript :: how to split two digit number in javascript 
Javascript :: document print from html javascript 
Javascript :: jquery get name attribute 
Javascript :: react autocomplete off for password chrome 
Javascript :: find longest word in string javascript 
Javascript :: how many days old am i 
Javascript :: typeahead cdn 
Javascript :: js how to remove # from any url using js 
Javascript :: how to change the color of error message in jquery validation 
Javascript :: node version check in cmd 
Javascript :: how to add up all numbers in an array 
Javascript :: get year from date javascript 
Javascript :: javascript remove final newline from string 
Javascript :: .find() is not a function 
Javascript :: use onchange with react select 
Javascript :: js input type range get value on select 
Javascript :: reading files with node.js 
Javascript :: convert elements to array javascript 
Javascript :: Uncaught TypeError: $(...).DataTable is not a function 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =