<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.111cn.net/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>js read cookies to clear cookie</title>
<script>
Read and Write Cookie functions
function GetCookie (c_name)
{
if (Document.cookie.length > 0)
{
C_start = Document.cookie.indexof (c_name + "=")
if (C_start!=-1)
{
C_start = C_start + c_name.length + 1;
C_end = Document.cookie.indexof (";", C_start);
if (c_end = = 1)
{
C_end = Document.cookie.length;
}
Return unescape (document.cookie.substring (c_start,c_end));
}
}
return null
}
function Setcookie (c_name,value,expiredays)
{
var exdate = new Date ();
Exdate.setdate (exdate.getdate () + expiredays);
Document.cookie = c_name + "=" +escape (value) + ((expiredays = = null)? "": "; expires=" + exdate.togmtstring ()); Make the setting valid for the correct time. Add toGMTString ()
}
</script>
<body>
</body>