Closed vincent-yao27 closed 7 years ago
you should set app.keys
to sign the cookie, so user can not modify your cookie from browser
thx. 😉 besides, is there any way else to pass the keys
to session
. adding a property to app
feels a bit of strange.
SORRY!! i didn't look up the docs of Koa 😢 it's totally my fault. thank you so much
it seems koa will pass the app.keys
to cookies
lib,
pillarjs/cookies
cookies = new Cookies( request, response, [ options ] )
# lib/application.js
context.cookies = new Cookies(req, res, {
keys: this.keys,
secure: request.secure
});
I think this is the truth.
There is no description about
app.keys
defined in the example. I wonder what's the use of it and if it's a must?