Improve cookie secure setting values

HTTPS 를 사용하는 상황에 대한 판단을 할 수 있는 상황에서 쿠키의 secure flag 를 달아준다.
This commit is contained in:
Min-Soo Kim 2018-04-22 23:58:13 +09:00
parent 3c1e5bd64f
commit 73da2af393
6 changed files with 12 additions and 7 deletions

View file

@ -1055,7 +1055,8 @@ function getOuterHTML(obj) {
function setCookie(name, value, expire, path) {
var s_cookie = name + "=" + escape(value) +
((!expire) ? "" : ("; expires=" + expire.toGMTString())) +
"; path=" + ((!path) ? "/" : path);
"; path=" + ((!path) ? "/" : path) +
((enforce_ssl) ? ";secure" : "");
document.cookie = s_cookie;
}