miolo-session-context

Manage session and context data across miolo SSR and CSR applications.

Updated Feb 4, 2022
One-click install
npx skills add https://github.com/afialapis/miolo --skill miolo-session-context
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: miolo-session-context
Source: https://github.com/afialapis/miolo/tree/main/skills/miolo-session-context
Command: npx skills add https://github.com/afialapis/miolo --skill miolo-session-context

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides unified session and context management for miolo applications, enabling consistent access to authentication state, user data, and route context on both server and client.

Core Features & Use Cases

  • Backend (server-side) context and session access for route handlers and middleware (ctx.request, ctx.session, ctx.isAuthenticated()).
  • Client-side context via useMioloContext and SessionProvider to drive UI based on authentication state.
  • Secure, centralized session management for protected routes, login/logout flows, and SSR/CSR data sharing.

Quick Start

Install and wrap your app with the SessionProvider and start using useMioloContext to access session data and authentication helpers.

Frequently Asked Questions about miolo-session-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage session and authentication state across backend and frontend in miolo applications?

Session and authentication state in miolo is managed by accessing ctx.session and ctx.isAuthenticated() on the backend, plus useMioloContext on the client for consistent user data access.

What is the best way to access user session data during server-side rendering?

Accessing user session data during server-side rendering is done through backend route handlers and middleware using ctx.request and ctx.session, ensuring protected routes have secure, centralized access to auth state before SSR completes.

How do I set up a login and logout flow that works for both SSR and CSR?

To set up login and logout flows for SSR and CSR, wrap your application with the SessionProvider and use the exposed authentication helpers to drive UI updates and manage session properties across both rendering strategies.

Can I use middleware to protect routes and check authentication state in miolo?

Yes, you can use middleware to protect routes by evaluating ctx.isAuthenticated() and ctx.session properties, securing backend route handlers and validating user permissions before proceeding.

Does miolo support sharing route context and user data between server and client components?

Miolo supports sharing route context and user data between server and client by utilizing the SessionProvider and useMioloContext, providing unified context management across SSR and CSR environments.