Skip to content

Commit

Permalink
fix: set samesite compatibility cookie as transient when the session is
Browse files Browse the repository at this point in the history
If the session is transient then legacy cookies should also be transient.

fixes #636
  • Loading branch information
mikejpeters authored and panva committed Jan 25, 2020
1 parent e4b278d commit 1257164
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/shared/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = async function sessionHandler(ctx, next) {
} finally {
const sessionCookieName = ctx.oidc.provider.cookieName('session');
const stateCookieName = ctx.oidc.provider.cookieName('state');
const longRegexp = new RegExp(`^(${sessionCookieName}|${stateCookieName}\\.[^=]+)(?:\\.sig)?=`);
const longRegexp = new RegExp(`^(${sessionCookieName}|${stateCookieName}\\.[^=]+)(?:\\.legacy)?(?:\\.sig)?=`);

// refresh the session duration
if ((!ctx.oidc.session.new || ctx.oidc.session.touched) && !ctx.oidc.session.destroyed) {
Expand Down

0 comments on commit 1257164

Please sign in to comment.