Managing State in Node.js Using express-session and bcrypt (Episode 1)

Поділитися
Вставка
  • Опубліковано 16 жов 2024
  • ⭕ Overview
    Hello, this is Christian. In this video, we're going to explore sessions in Node.js. Before diving into the technical details, let's understand the importance of sessions in web applications.
    Imagine you have a website with both public and restricted content. The public pages are accessible to everyone, but you have certain sections that you want to keep private, only accessible to authenticated users. Without a proper session management system, every time a user navigates to a different restricted page, they would need to log in again, which can be very frustrating and inconvenient.
    Sessions solve this problem by maintaining a user's login state across multiple pages. When a user logs in, a session is created, allowing them to access all restricted content without needing to log in again for each page. This seamless access significantly improves the user experience.
    In this tutorial, I'll show you how to implement session management in a Node.js application. We'll start by setting up a basic login system and then extend it to create and manage user sessions. This will involve using session middleware to handle the session creation and storage.
    We'll also look at practical examples of securing different pages, ensuring that only authenticated users can access certain information. By the end of this video, you'll have a solid understanding of how sessions work and how to implement them in your Node.js applications to enhance security and usability.
    If you find this video helpful, please give it a thumbs up, share it with your friends, and subscribe to my channel for more tutorials and insights into programming. Your support helps me create more content to assist you in your learning journey. Thank you for watching!
    Episode 1: Create sessions to show/hide content using the express-sessions and cookie-parser modules.
    Episode 2: Creating login, logout and registration pages and hash/unhash passwords into/from a PostgreSQL database.
    Episode 3: Hash/unhash passwords into/from a MongoDB database.
    ⭕ Chapters
    0:00 - Introduction
    ⭕ About me
    I am a Web instructor and author for Linkedin Learning (formerly Lynda.com), Packt, E-C Council, Udemy, and MC Press.
    ⭕ Visit my site: christianhur.com
    ⭕ My complete online training courses:
    ☑️ REST APIs & AJAX Operations Using Node, Express, and jQuery: www.udemy.com/...
    ☑️ Build Clean and Secure PHP Web Apps From Scratch: www.udemy.com/...
    ☑️ Angular 9 New Features: www.packtpub.c...
    ☑️ Full-Stack Web Development with Flask: www.packtpub.c...
    ☑️ Full-Stack Web Development with Django & Angular 8: www.packtpub.c...
    ☑️ Angular 7 New Features: www.packtpub.c...
    ☑️ The DOM in JavaScript, jQuery, AngularJS, and React : / the-dom-in-javascript-...
    ☑️ Building JSF Web Applications with Java EE 7: / building-jsf-web-appli...
    ☑️ Troubleshooting Vue.js: www.packtpub.c...
    ⭕ Check out my book:
    Developing Business Applications for the Web: With HTML, CSS, JSP, PHP, ASP.NET, and JavaScript is available on Amazon and MC Press.
    ☑️ Link: www.mc-store.c...

КОМЕНТАРІ • 2

  • @drearyhope1306
    @drearyhope1306 11 місяців тому +1

    Hey sir, great video! Is there any chance for you to make some videos about authorization, like role based maybe?

    • @ChristianHur
      @ChristianHur  11 місяців тому +1

      Good suggestion. I’ll have to think about that. Thanks for watching and your feedback.