managing-user-sessions

Manage Scalekit web sessions with encrypted HttpOnly cookies and token refresh middleware.

Updated Mar 2, 2026
One-click install
npx skills add https://github.com/scalekit-inc/github-copilot-authstack --skill managing-user-sessions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: managing-user-sessions
Source: https://github.com/scalekit-inc/github-copilot-authstack/tree/main/plugins/full-stack-auth/skills/manage-user-sessions
Command: npx skills add https://github.com/scalekit-inc/github-copilot-authstack --skill managing-user-sessions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manages Scalekit-backed user sessions by securely storing access/refresh/ID tokens (with encryption and correct cookie attributes), validating access tokens on every request, transparently refreshing tokens in middleware, and optionally revoking sessions remotely via Scalekit session APIs. Use when building session persistence for only for web apps. For SPAs this is NOT the skill.

Core Features & Use Cases

  • Secure token storage using HttpOnly cookies with proper domain/path and SameSite settings
  • Transparent token refresh flow via middleware
  • Optional remote session revocation via Scalekit API
  • Supports traditional web apps and remote session management

Quick Start

Configure secure session storage, automatic token refresh, and optional remote session revocation for a traditional web application.

Frequently Asked Questions about managing-user-sessions

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

FAQPage Schema
How do I securely manage user sessions for traditional server-rendered web apps?

Secure session management is automated by encrypting access, refresh, and ID tokens, storing them in HttpOnly and Secure cookies, and validating access tokens on every request. This approach is specifically designed for traditional server-rendered web apps.

Can I use this session management middleware for a single-page application?

No, this session management middleware explicitly does not support single-page applications (SPAs). It is designed strictly for traditional server-rendered web apps that persist user sessions.

How does middleware handle transparent token refresh for web sessions?

Token refresh is handled transparently by a verify-and-refresh middleware that validates access tokens on every request and automatically refreshes expired tokens during the request lifecycle.

What cookie attributes are required for secure token storage?

Secure token storage requires HttpOnly and Secure cookies with proper SameSite settings, along with encrypted storage for access, refresh, and ID tokens to prevent unauthorized access.

How do I revoke a user session remotely using Scalekit APIs?

Remote session revocation is optionally handled via Scalekit session APIs, allowing you to invalidate active user sessions remotely from your server-rendered web application.