You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After reading the documentation I don't have it very clear what is the keys parameter for in the cookie-session configuration.
I'm not an expert on cookies and the description doesn't help me much on that regard.
keys
The list of keys to use to sign & verify cookie values. Set cookies are always signed with keys[0], while the other keys are valid for verification, allowing for key rotation.
But it seems to be a compulsory field, if I don't add it I get an error:
C:\inetpub\wwwroot\app\node_modules\cookie-session\index.js:55
if (!keys && opts.signed) throw new Error('.keys required.');
So I ended up using keys: ['key1', 'key2'] as in the examples, but I have no idea why.
The text was updated successfully, but these errors were encountered:
You only have to set it if you have signed: true set (which I is by default). You can just specify signed:false in your options and then not provide keys.
After reading the documentation I don't have it very clear what is the
keys
parameter for in the cookie-session configuration.I'm not an expert on cookies and the description doesn't help me much on that regard.
But it seems to be a compulsory field, if I don't add it I get an error:
So I ended up using
keys: ['key1', 'key2']
as in the examples, but I have no idea why.The text was updated successfully, but these errors were encountered: