marko/session

Session interfaces and infrastructure for Marko Framework

Maintainers

Package info

github.com/marko-php/marko-session

Type:marko-module

pkg:composer/marko/session

Transparency log

Statistics

Installs: 355

Dependents: 7

Suggesters: 1

Stars: 0

0.8.5 2026-07-26 15:19 UTC

This package is auto-updated.

Last update: 2026-07-26 15:35:46 UTC


README

Session interfaces and infrastructure--defines session management, flash messages, and garbage collection without coupling to a storage backend.

Installation

composer require marko/session

This package is inert on its own --- it defines contracts only. Session handling activates when you install a driver package (marko/session-file or marko/session-database), which registers the implementation and middleware automatically.

Quick Example

use Marko\Session\Contracts\SessionInterface;

public function __construct(
    private readonly SessionInterface $session,
) {}

public function handle(): void
{
    $this->session->start();
    $this->session->set('user_id', 42);
    $this->session->flash()->add('success', 'Profile updated.');
    $this->session->save();
}

Documentation

Full usage, API reference, and examples: marko/session