Generating Access & Refresh Tokens After Login (Session + JWT)

Thapa Technical
Thapa Technical
Mar 12, 2025

💸 Get All My YouTube Videos' Source Code for just ₹249! Grab Now - https://thapatechnical.shop/source-code

📺 Watch the complete Node.JS Playlist here :https://youtube.com/playlist?list=PLwGdqUZWnOp3KELplHtc-RnJ5xTUPqdgH&si=_ob8F88HYxCdspup

🔥 Access Source Code, PPT & Notes here for Free : https://www.thapatechnical.com/2024/11/introduction-to-nodejs.html
------------------------------------------------------------------------
In this video, we are storing session data in the database after user login and generating both Access & Refresh Tokens. These tokens are then securely stored in cookies to manage authentication efficiently.

You will learn:
✅ Why Access & Refresh Tokens are needed for authentication
✅ How to store session details in the database
✅ How to generate Access & Refresh Tokens
✅ Setting up secure cookies for authentication
✅ Passing tokens as cookies after login
✅ Testing the implementation

🚀 Boost Your Skills with these Pre-Requisite Videos:

🔗 Best HTML Course - https://youtu.be/5ccq_nLHneE
🔗 Best CSS Course - https://youtu.be/MSICFljRcb4
🔗 JavaScript Basics Course Part 1 - https://youtu.be/13gLB6hDHR8
🔗 JavaScript Advanced Course Part 2 - https://youtu.be/YwsOCN8woA8

------------------------------------------------------------------------
💸 Build Your Own E-commerce Website for Free! - https://www.thapatechnical.com/2024/03/build-complete-ecommerce-website-using.html

------------------------------------------------------------------------
✌️ Join Us!

🚀 Become a Member: Unlock perks, free source code, and more Join Now : https://www.youtube.com/channel/UCwfaAHy4zQUb2APNOGXUCCA/join
📷 Connect on Instagram: https://www.instagram.com/thapatechnical
🗨️ Join Our Discord Server: Hang out with fellow programmers Discord Link: https://discord.gg/MdScmCsua6

------------------------------------------------------------------------

⌛TIMELINE⏳
📍 0:00 - Introduction: Generating Access & Refresh Tokens After Login
📍 0:14 - Why Do We Need Access & Refresh Tokens?
📍 0:50 - Accessing the Source Code
📍 1:38 - What We Are Going to Code Today
📍 2:25 - Storing Session Data in the Database
📍 10:15 - Creating Access & Refresh Tokens
📍 14:15 - Setting Up Base Configuration for Cookies
📍 16:00 - Passing Tokens as Cookies After Login
📍 18:00 - Running & Testing the Code