Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Create Your Own Auth with Cookie Sessions in Next.js Using Server Actions

Lama Dev via YouTube

Overview

Learn how to implement cookie-based authentication and authorization in Next.js 14 using iron-session and server actions. Explore the creation of pages in the App Router, set up iron-session for secure cookie management, and implement server actions for login and logout functionality. Discover techniques for retrieving and updating user sessions, protecting routes, and handling form errors with the useFormState hook. Master the process of securing premium content and updating user sessions on each request to enhance your Next.js application's security and user management capabilities.

Syllabus

Introduction
Creating Pages in App Router
Next.js 14 Iron-Session Tutorial
Cookie Session Auth Server Actions
How to Get User Session in Next.js?
Next.js Cookie Session Login with Server Actions
Next.js Cookie Session Logout with Server Actions
Next.js Server Actions Show The Form Error with useFormState Hook
Next.js Protected Routes with Cookie Session
How to Update the User Session in Next.js?
Protect the Premium Page in Next.js
Update the User Session on Each Request in Next.js
Outro

Taught by

Lama Dev

Reviews

Start your review of Create Your Own Auth with Cookie Sessions in Next.js Using Server Actions

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.