Secure cookies now in use

This commit is contained in:
Kasper Rynning-Tønnesen
2016-11-21 12:55:04 +01:00
parent b1a41ca74a
commit 8ac79898b8
2 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,7 @@ var Crypt = {
init: function(){ init: function(){
document.cookie = chan.toLowerCase() + '=; path=/' + chan.toLowerCase() + '; expires=' + new Date(0).toUTCString(); document.cookie = chan.toLowerCase() + '=; path=/' + chan.toLowerCase() + ';secure;expires=' + new Date(0).toUTCString();
try{ try{
conf_arr = Crypt.decrypt(Crypt.getCookie("_opt"), "_opt"); conf_arr = Crypt.decrypt(Crypt.getCookie("_opt"), "_opt");
@@ -63,7 +63,7 @@ var Crypt = {
var CookieDate = new Date(); var CookieDate = new Date();
CookieDate.setFullYear(CookieDate.getFullYear( ) +1); CookieDate.setFullYear(CookieDate.getFullYear( ) +1);
document.cookie = cookie+"="+encrypted.toString()+";expires="+CookieDate.toGMTString()+";path=/;"; document.cookie = cookie+"="+encrypted.toString()+";secure;expires="+CookieDate.toGMTString()+";path=/;";
}, },
encrypt_string: function(string){ encrypt_string: function(string){
@@ -106,7 +106,7 @@ var Crypt = {
var CookieDate = new Date(); var CookieDate = new Date();
CookieDate.setFullYear(CookieDate.getFullYear( ) +1); CookieDate.setFullYear(CookieDate.getFullYear( ) +1);
document.cookie = name+"="+encrypted.toString()+";expires="+CookieDate.toGMTString()+";path=/;"; document.cookie = name+"="+encrypted.toString()+";secure;expires="+CookieDate.toGMTString()+";path=/;";
//document.cookie = name+"="+encrypted.toString()+";expires="+CookieDate.toGMTString()+";path=/;" //document.cookie = name+"="+encrypted.toString()+";expires="+CookieDate.toGMTString()+";path=/;"
//document.cookie = na"="+encrypted.toString()+";expires="+CookieDate.toGMTString()+";path=/;" //document.cookie = na"="+encrypted.toString()+";expires="+CookieDate.toGMTString()+";path=/;"
return Crypt.getCookie(name); return Crypt.getCookie(name);