Skip to content
Permalink
Browse files

Only add the secure flag when the cookie should be secure

  • Loading branch information...
carakas committed Sep 24, 2019
1 parent d717a03 commit 9079713646efdca58d84d404ad12d114d7952c87
@@ -12,7 +12,7 @@ parameters:
fork.debug_message: 'Internal error.'
fork.version: '5.6.2'

session.cookie_secure: false
session.cookie_secure: false
site.protocol: <site-protocol>
site.domain: <site-domain>
site.default_title: <site-default-title>
@@ -12,7 +12,7 @@ parameters:
fork.debug_message: 'Internal error.'
fork.version: '5.6.2'

session.cookie_secure: false
session.cookie_secure: false
site.protocol: http
site.domain: fork.local
site.default_title: Fork CMS
@@ -75,7 +75,7 @@ utils.cookies = {

var expireDate = new Date()
expireDate.setDate(expireDate.getDate() + days)
document.cookie = name + '=' + escape(value) + ';expires=' + expireDate.toUTCString() + ';path=/;secure=' + secure
document.cookie = name + '=' + escape(value) + ';expires=' + expireDate.toUTCString() + ';path=/' + secure ? ';secure=true' : ''
}
}

@@ -75,7 +75,7 @@ utils.cookies = {

var expireDate = new Date()
expireDate.setDate(expireDate.getDate() + days)
document.cookie = name + '=' + escape(value) + ';expires=' + expireDate.toUTCString() + ';path=/;secure=' + secure
document.cookie = name + '=' + escape(value) + ';expires=' + expireDate.toUTCString() + ';path=/' + secure ? ';secure=true' : ''
}
}

0 comments on commit 9079713

Please sign in to comment.
You can’t perform that action at this time.