1

Are there any existing Session management libraries for node.js? I'm looking for something that can do password authentication for a user (using MongoDB as backend) and maintain the session.

Jayanth
  • 485
  • 3
  • 9
  • 17

2 Answers2

1

There are several solutions. The most prominent of which is most likely Passport.js. It supports basic password authentication, as well as oAuth based authentication strategies for a variety of sites. It can also serialize users into the session easily, and can be used as Express middleware.

Passport's biggest competitor currently seems to be EveryAuth, which also supports password authentication, but seems to be more focused on oAuth-based solutions. Both of these play excellently with MongoDB, and the sessions can be persistent, depending on how they're stored. (Memory Stored sessions will be cleared on Reboots, while Redis/MongoDB sessions will persist. [Redis is probably the best, since it's a fast key-value store, comparable to the speed of memory access]).

If you're looking at how to manage the session itself, there's Connect, which used to be bundled with Express, or available as a standalone library, and is perfect for handling sessions.

Brandon Anzaldi
  • 6,884
  • 3
  • 36
  • 55
0

Yes.There is a library called passport.js(Its got social auth,local auth and session maintainence) http://passportjs.org/

harryy000
  • 553
  • 3
  • 9