Server Components and Server Actions
App Router
How to test: Login and refresh the page to see iron-session in action.
Protected page → redirects back here unless you are logged in, checked in the Data Access Layer.
How it works
- During login, the page uses a server action.
- During logout, the page uses a server action.
- When displaying session data, the server component gets the data and pass it to the page.