Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Confusing cookieParser & cookieSession #722

Closed
scriby opened this Issue · 2 comments

3 participants

@scriby

My first attempt at getting the session cookie store to work was like this:

app.use(express.cookieParser(secret));
app.use(express.cookieSession({
    secret: secret
}));

But for some reason it doesn't work if you pass the secret to the cookieParser as well. Whether this is intended or not, I don't know, but I found it confusing.

After stepping through the code I figured out this combination would work:

app.use(express.cookieParser());
app.use(express.cookieSession({
    secret: secret
}));
@tj
Owner
tj commented

it should try cookieParser's secret first for legacy, and then the one passed via options

@jonathanong jonathanong was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.