Javascript Cookie

Posted by Ajith on Stack Overflow See other posts from Stack Overflow or by Ajith
Published on 2010-04-12T10:04:46Z Indexed on 2010/04/12 10:13 UTC
Read the original article Hit count: 258

Filed under:

How can i create a cookie by using javascript just for end of the browser session(ie,upto closing of current browser).My script is like follows;

function setCookie(c_name,c_value,c_expiredays) {
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+c_expiredays);
    document.cookie=c_name+ "=" +escape(c_value)+
    ((c_expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

setCookie('gs_cookie','firstme',1600000);`

How much value i need to pass instead of 1600000. Please help....

© Stack Overflow or respective owner

Related posts about JavaScript