1window.onbeforeunload = function (e) {
2 deleteAllCookies();
3}
4
5function deleteAllCookies() {
6 var cookies = document.cookie.split(";");
7
8 for (var i = 0; i < cookies.length; i++) {
9 var cookie = cookies[i];
10 var eqPos = cookie.indexOf("=");
11 var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
12 document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
13 }
14}
15
1function deleteAllCookies() {
2 var cookies = document.cookie.split(";");
3
4 for (var i = 0; i < cookies.length; i++) {
5 var cookie = cookies[i];
6 var eqPos = cookie.indexOf("=");
7 var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
8 document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
9 }
10}
11