Skip to content

Commit

Permalink
set cookie "secure" and "SameSite" flags by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbien committed Sep 13, 2021
1 parent 27c1201 commit c86fffe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/main/webapp/theme/scripts/roller.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
* directory of this distribution.
*/
/* This function is used to set cookies */
function setCookie(name,value,expires,path,domain,secure) {
function setCookie(name, value, expires, path, domain, secure=true, sameSite=true) {
document.cookie = name + "=" + escape (value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "") +
((sameSite) ? "; SameSite=Strict" : "");
}

/* This function is used to get cookies */
Expand Down

0 comments on commit c86fffe

Please sign in to comment.