»
EnglishFrenchVietnamese

Print - Delete those cookies - JavaScriptBank.com

Full version: jsB@nk » Cookie » Delete those cookies
URL: https://www.javascriptbank.com/delete-those-cookies.html

Delete those cookies © JavaScriptBank.comThis JavaScript checks JavaScript cookie data and will delete all them if available.

Full version: jsB@nk » Cookie » Delete those cookies
URL: https://www.javascriptbank.com/delete-those-cookies.html



HTML
<script language="Javascript" type="text/javascript"><!-- Hide script from older browsers    if (document.cookie != "") {    if (confirm("Do you want to delete the cookies?")) {    thisCookie = document.cookie.split("; ")        expireDate = new Date        expireDate.setDate(expireDate.getDate()-1)                                       for (i=0; i<thisCookie.length; i++) {            cookieName = thisCookie[i].split("=")[0]            document.cookie = cookieName + "=;expires=" + expireDate.toGMTString()        }        document.write("<h1>Number of cookies deleted: " + thisCookie.length + "<\/h1>")        }    }// End hiding script --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->