How to save and retrieve session from Redis

That should be all there is to it. You access the session in your route handlers via req.session. The sessions are created, saved, and destroyed automatically.

If you need to manually create a new session for a user, call req.session.regenerate().

If you need to save it manually, you can call req.session.save().

If you need to destroy it manually, you can call req.session.destroy().

See the Connect documentation for the full list of methods and properties.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)