cookie :3

This commit is contained in:
awesomeuser 2023-08-02 21:23:15 +00:00
parent 3a5b101479
commit 7e92c88b22

View file

@ -84,11 +84,14 @@
<!-- save most recent signature as a cookie and autoload on page load --> <!-- save most recent signature as a cookie and autoload on page load -->
<script> <script>
function logSignature() { function logSignature() {
// save signature to cookie // save signature to cookie;
document.cookie = "signature=" + document.getElementById("signature-input").defaultValue; const d = new Date();
d.setTime(d.getTime() + (1 * 24 * 60 * 60 * 1000));
document.cookie = "signature=" + document.getElementById("signature-input").defaultValue + "; expires=" + d.toUTCString() + ";path=/";
} }
// load caches signature // load caches signature
alert(document.cookie);
if (document.cookie.includes('=')) { if (document.cookie.includes('=')) {
document.getElementById("signature-input").defaultValue = document.cookie.split('=')[1]; document.getElementById("signature-input").defaultValue = document.cookie.split('=')[1];
} }