Intro to Sessions / Adding Pages | Node Auth Tut - Part 4

Released on June 17th 2017
Length: 08:31

A session can be seen as a place where your app stores data. With this form of data storage, we can code our app in a way so that when a user logs in via a login form, they are “logged in” until they explicitly click a logout button. When a user logs in, what’s really happening is that we are creating a session on the backend of our app specifically for whatever user just entered their credentials (each user gets their own session), and returning to the user a cookie that’s used for continuous authentication, preventing the need for a user to re-enter their account credentials each time they’d like to visit a restricted page. It should be noted, session data is volatile, meaning that it’s created and deleted frequently depending on whether or not a user logs in or logs out. In addition, all app sessions will be deleted in their entirety if the app is restarted with something such as nodemon. It’s important we don’t log out all of our users if we restart our app during a deployment, so we’ll want to integrate something called session storage to move all sessions to a database, rather than storing them directly within express. This episode describes the process briefly and then moves onto creating the additional pages we’ll need to log a user in. Video Timeline: ----------------------------- 0:40 - Intro to sessions: The process behind logging in 3:07 - Creating additional pages to test login functionality Support Chris Courses On Patreon: ------------------------------------------------- https://www.patreon.com/chriscourses The Platform: ------------------------- http://chriscourses.com is a platform in progress whose goal is to educate aspiring and seasoned web developers via story driven learning. Each course tells a different story, and each milestone reveals a different scene. With an expansive universe to explore, you can track your progress, and gain the necessary skills needed to build your dreams. For updates on the progress of chriscourses.com and future videos, join the Chris Courses mailing list at http://chriscourses.com. Chris Courses Social: ------------------------------------- Twitter: https://twitter.com/chriscourses Facebook: https://www.facebook.com/chriscourses Christopher Lis Social: --------------------------------------- Twitter: https://twitter.com/christopher4lis CodePen: http://codepen.io/christopher4lis