When the cookie is set on the client’s browser , it can persist for days , months or years , This makes it easy to save user preferences & visit information , The cookies are stored on the client’s hard disk , so , if the server crashes , the cookies are still available .
First, we create a function that stores the name of the visitor in a cookie variable:
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays2460601000));
var expires = "expires="+ d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
Labels |
Added:
?
|
This is a troll, close it.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-03-17 18:05:28 |
Closed_By | ⇒ | Quy |
The title of this request has nothing to do with the content of the request.