Delete all cookies : Cookie « Development « JavaScript Tutorial






<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!--
expireAt = new Date;
expireAt.setMonth(expireAt.getMonth() - 1);

if (document.cookie != "")
{
        crumbs = document.cookie.split(";");
        for(i=0; i < crumbs.length; i++)
        {
            crumbName = crumbs[i].split("=")[0];
            document.cookie = crumbName + "=;expires=" + expireAt.toGMTString();
        }
}
//  -->
</script>
</head>
<body>

</body>
</html>








4.4.Cookie
4.4.1.JavaScript and Cookies
4.4.2.Reading Cookies
4.4.3.Writing Cookies
4.4.4.Create a cookie and read it back
4.4.5.Make cookie using Javascript
4.4.6.Delete all cookies
4.4.7.Read cookie value