you will be using the token-based approach. The cookie-based approach is a bit easier to set up, but it is inflexible. Using tokens, you can come up with clever ways to authenticate the user and provide a more seamless experience. It also eases debugging and troubleshooting since you just need the token to interact with the API. It also allows the API to be accessed via a mobile app in the same way. It helps with performance since the token is validated using an algorithm rather than a database hit on every request.
- Chapter 7. Building Authentication in Node.js
- from Write Modern Web Apps with the MEAN Stack: Mongo, Express, AngularJS, and Node.js
- Publisher: Peachpit Press
- Released: September 2014
Token based and cookie based authentication
Share this highlighthttp://www.safaribooksonline.com/a/write-modern-web/53823/