diff --git a/coinmanager/coinc/static/coinc/modules/cookie.mjs b/coinmanager/coinc/static/coinc/modules/cookie.mjs index 517c283..79de938 100644 --- a/coinmanager/coinc/static/coinc/modules/cookie.mjs +++ b/coinmanager/coinc/static/coinc/modules/cookie.mjs @@ -17,6 +17,7 @@ along with this program. If not, see . */ +/* manage cookies */ class Cookie { constructor(cookie_name='', value='', expire_days=365, path='/') { @@ -28,8 +29,8 @@ class Cookie { } + /* save a cookie */ set(name, value, expire_days=365, path='/') { - // save a cookie let date = new Date(); date.setTime(date.getTime() + (expire_days * 24 * 60 * 60 * 1000)); @@ -38,8 +39,8 @@ class Cookie { } + /* return a cookie */ get(cookie_name) { - // return a cookie let name = cookie_name + '='; let cookies = document.cookie.split(';'); @@ -60,9 +61,8 @@ class Cookie { } + /* delete a cookie */ delete(name) { - // deleta a cookie - this.set(name, '', -1) } }