Skip to content

Commit

Permalink
fix(config): set sameSite to false
Browse files Browse the repository at this point in the history
sameSite true on chrome doesn't returns the cookies when got redirected from a different domain
  • Loading branch information
thetutlage committed Sep 6, 2017
1 parent 739a11d commit 44dfeb2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ util.getCookieOption = function (Config, keyPrefix = null) {
*/
const options = Config.merge('session.cookie', {
httpOnly: true,
sameSite: true
sameSite: false
})

/**
Expand Down
1 change: 0 additions & 1 deletion templates/config.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ module.exports = {
*/
cookie: {
httpOnly: true,
sameSite: true,
path: '/'
},

Expand Down
6 changes: 3 additions & 3 deletions test/cookie-driver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test.group('Drivers - Cookie', () => {
test('set default options when config is missing', (assert) => {
const cookie = new Cookie(new Config())
assert.isTrue(cookie._options.httpOnly)
assert.isTrue(cookie._options.sameSite)
assert.isFalse(cookie._options.sameSite)
assert.isAbove(Date.parse(cookie._options.expires) - Date.now(), 1000 * 60 * 90)
})

Expand All @@ -30,7 +30,7 @@ test.group('Drivers - Cookie', () => {
config.set('session.age', '20 mins')
const cookie = new Cookie(config)
assert.isTrue(cookie._options.httpOnly)
assert.isTrue(cookie._options.sameSite)
assert.isFalse(cookie._options.sameSite)
assert.isAbove(Date.parse(cookie._options.expires) - Date.now(), 1000 * 60 * 19)
assert.isBelow(Date.parse(cookie._options.expires) - Date.now(), 1000 * 60 * 60)
})
Expand All @@ -40,7 +40,7 @@ test.group('Drivers - Cookie', () => {
config.set('session.age', 1000 * 60 * 20)
const cookie = new Cookie(config)
assert.isTrue(cookie._options.httpOnly)
assert.isTrue(cookie._options.sameSite)
assert.isFalse(cookie._options.sameSite)
assert.isAbove(Date.parse(cookie._options.expires) - Date.now(), 1000 * 60 * 19)
assert.isBelow(Date.parse(cookie._options.expires) - Date.now(), 1000 * 60 * 60)
})
Expand Down

0 comments on commit 44dfeb2

Please sign in to comment.