Generate a cookie with Javascript
 

Generate a cookie with Javascript

Cookie identification : Cookie_Name=Cookie_Value;expires=Cookie_Date

Sample : UserName=Mark;expires= Fri, 12 Jul 2013 07:47:04 GMT

var cookieName="UserName"

var cookieValidDate = new Date();

cookieValidDate.setDate(cookieValidDate.getDate());

var cookieValue = escape("Mark") + ("; expires=" + cookieValidDate.toUTCString());

document.cookie = cookieName + "=" + cookieValue;

Cookie is created.

 

Read a Cookie with Javascript

Sample : var cookies = document.cookie;  

 

Author: Engin ATALAY
Date: 10.09.2013 15:47:23
View Count: 1022
 
 

COMMENTS
 
No comments yet. Be the first to comment who you are.
 
 
 
 
 
 
 
WRITE COMMENT
 
 
Your Name :
 
 
 
E-mail :
 
 
 
Your Message :
 
 
 
 
 
 
 
This project : ASP.NET MVC , RAZOR, Entity Framework , CSS , HTML , JQUERY(2.0.2) , AJAX the C# side-tier architecture was developed with logic.
 
Yukarı Çık