projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix squares colors on diagrams
[vchess.git]
/
client
/
src
/
utils
/
cookie.js
diff --git
a/client/src/utils/cookie.js
b/client/src/utils/cookie.js
index
78551a2
..
3480224
100644
(file)
--- a/
client/src/utils/cookie.js
+++ b/
client/src/utils/cookie.js
@@
-1,14
+1,14
@@
// Source: https://www.quirksmode.org/js/cookies.html
export function setCookie(name, value) {
// Source: https://www.quirksmode.org/js/cookies.html
export function setCookie(name, value) {
-
var
date = new Date();
+
const
date = new Date();
date.setTime(date.getTime() + 183 * 24 * 60 * 60 * 1000); //6 months
date.setTime(date.getTime() + 183 * 24 * 60 * 60 * 1000); //6 months
-
var
expires = "; expires=" + date.toGMTString();
+
const
expires = "; expires=" + date.toGMTString();
document.cookie = name + "=" + value + expires + "; path=/";
}
export function getCookie(name, defaut) {
document.cookie = name + "=" + value + expires + "; path=/";
}
export function getCookie(name, defaut) {
-
var
nameEQ = name + "=";
-
var
ca = document.cookie.split(";");
+
const
nameEQ = name + "=";
+
const
ca = document.cookie.split(";");
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == " ") c = c.substring(1, c.length);
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == " ") c = c.substring(1, c.length);