Yummy is cookie session middleware for connect and its derivatives.
Cause you already have to use a cookie for sessions so why do more IO to get the data? Yummy encrypts the session data to prevent tampering as well as reading of the raw session data by the client.
npm install yummy
Just drop the yummy middleware into your middleware stack after the cookie parser
var yummy = ;app;app;
tell me more
You can configure yummy with the following options.
the cookie will be encrypted using this secret string, keep it safe :)
The default encryption is aes256 which means your secret should be at least 256 bits (32 characters). It is best if you use a randomly generated string.
the cookie options sets the default value for session cookies. You can
I would suggest setting
secure: truefor a more secure setup in production.
the max age of the cookie in seconds
the path of the session cookie (default is '/')
If you want to authenticate users for websocket sessions, the middleware exposes a
decode property. The property will decode cookie strings.
var middleware = ;// in the websocket auth// cookies is an object of cookie name -> valuesvar session = middleware;// session is now populated with the session data