utils.js: set Secure flag on cookies if using HTTPS
Related to https://gitlab.com/commento/commento-ce/issues/79
This commit is contained in:
parent
2a713c22f1
commit
405d10766a
@ -71,7 +71,11 @@
|
||||
date.setTime(date.getTime() + (365*24*60*60*1000));
|
||||
expires = "; expires=" + date.toUTCString();
|
||||
|
||||
document.cookie = name + "=" + value + expires + "; path=/";
|
||||
var cookieString = name + "=" + value + expires + "; path=/";
|
||||
if (/^https:\/\//i.test(commentoOrigin))
|
||||
cookieString += "; secure";
|
||||
|
||||
document.cookie = cookieString;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user