cookie :3
This commit is contained in:
parent
3a5b101479
commit
7e92c88b22
1 changed files with 5 additions and 2 deletions
|
@ -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];
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue