GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/JimMartinson/CST1022/Resources/Week/12/ |
Upload File : |
<!DOCTYPE html> <html lang="en"> <head> <title>Cookies read only</title> <meta charset="utf-8"> </head> <body> <h1>Cookies read only</h1> <p id="para1">Before the script...</p> <button onclick="clearInt();">clear Interval</button> <button onclick="startInt();">restart Interval</button> <br> <button onclick="document.cookie='user=; max-age=0; secure; samesite=lax';">Delete user cookie</button> <p id="theCookies"></p> <script> "use strict"; // readCookies(); // let setIntervalId = setInterval(readCookies, 1000); let setIntervalId; let theCookies = document.getElementById('theCookies'); function startInt() { console.clear(); clearInterval(setIntervalId); readCookies(); setIntervalId = setInterval(readCookies, 10000); } startInt.counter = 0; function readCookies() { readCookies.counter++; // console.log(`${readCookies.counter} document.cookie = \n${document.cookie}`); // show all cookies let siteCookies = document.cookie.split(';'); console.log(`${readCookies.counter} length=${siteCookies.length} document.cookie = \n`); theCookies.innerHTML += `<span style="color:green">${startInt.counter} seconds = </style><br>`; startInt.counter += 10; siteCookies.forEach(thisCookie => { let thisCookieClean = decodeURIComponent(thisCookie.trim()); console.log(`\t${thisCookieClean}\n`); theCookies.innerHTML += `\t${thisCookieClean}<br>\n`; }); } readCookies.counter = 0; function clearInt() { clearInterval(setIntervalId); theCookies.innerHTML = 'Starting<br>'; } startInt(); </script> <p id="para2">...After the script.</p> </body> </html>