marko / session-database
Database session driver for Marko Framework
Package info
github.com/marko-php/marko-session-database
Type:marko-module
pkg:composer/marko/session-database
0.11.0
2026-10-06 13:35 UTC
Requires
- php: ^8.5
- marko/clock: 0.11.0
- marko/database: 0.11.0
- marko/session: 0.11.0
Requires (Dev)
- marko/database-mysql: 0.11.0
- marko/database-pgsql: 0.11.0
- marko/testing: 0.11.0
- pestphp/pest: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Database session driver — stores session data in a SQL table for shared access across multiple application servers.
Installation
composer require marko/session-database
Requires marko/database for the database connection. Then run marko db:migrate to create the sessions table from the entity the package ships.
Quick Example
use Marko\Session\Contracts\SessionInterface; public function __construct( private readonly SessionInterface $session, ) {} public function handle(): void { $this->session->set('user_id', 42); }
Installing this package automatically registers the database handler, binds SessionInterface, and adds SessionMiddleware globally. No other configuration is needed.
Documentation
Full usage, API reference, and examples: marko/session-database