serverpod-sessions

Official

Manage session lifecycle safely in Dart.

Authorserverpod
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Prevents session-related bugs by teaching how Serverpod sessions are created, used, and closed so you avoid leaked resources and “session closed” errors.

Core Features & Use Cases

  • Session types and lifetimes: Understand which session is created for method calls, web routes, streams, WebSockets, future calls, and manual internal sessions.
  • Safe manual session management: Learn how to close InternalSession reliably (including why unclosed sessions leak memory and logs).
  • Cleanup callbacks and correct timing: Use addWillCloseListener correctly and avoid capturing request sessions for work that runs after the endpoint returns.
  • Use case: When debugging a “StateError: session already closed” caused by a delayed callback (like a timer), apply the guidance to refactor the work into a future call or a fresh internal session.

Quick Start

Ask the assistant to explain which session type you’re using and how to refactor your code so it never uses a session after the endpoint returns.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: serverpod-sessions
Download link: https://github.com/serverpod/serverpod/archive/main.zip#serverpod-sessions

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.