June 2014
Intermediate to advanced
696 pages
38h 52m
English
A major downside to basic HTTP authentication is that the login sticks around as long as the credentials are stored and is not very secure. A much better method is to implement your own authentication and store it in a session that you can expire whenever you want.
The session middleware inside Express works very well for implementing session authentication. The session middleware attaches a Session object req.session to the Request object to provide the session functionality. Table 19.1 describers the methods you can call on the res.session object.
Table 19.1 Methods on the res.session object to manage sessions ...
Read now
Unlock full access