JS settings and read cookie value code
<script language= "javascript tutorial" >
Function Setcookie (name, value) //cookies setting
{
var argv = setcookie.arguments;
var argc = setCookie.arguments.length;
& Nbsp;var expires = (argc > 2)? ARGV[2]: null;
if (expires!=null)
{
var largeexpdate = new Date ();
Largeexpdate.settime (Largeexpdate.gettime () + (expires*1000*3600*24));
}
document.cookie = name + "=" + Escape (value) + ((expires = null)? "" : ("; Expires= "+largeexpdate.togmtstring ()));
}
function GetCookie (Name)//cookies read
{
var search = Name + "="
if (Document.cookie.length > 0)
{
offset = document.cookie.indexOf (search)
if (offset!=-1)
{
Offset + = Search.length
End = Document.cookie.indexOf (";", offset)
if (end = = 1) end = Document.cookie.length
return unescape (offset, end) (document.cookie.substring)
}
else return ""
}
}
Setcookie (' 111cnNet ', ' aaa ');//Set cookie value
var bf =getcookie (' 111CN. Net ');//Read Cookie value
</script>