Custom MySQL session handler uses Nextras/DBAL and Nette DI
- nextras/dbal 3.0+
- nette/di 2.2+
- PHP 8.2+
Use Composer to install package janharsa/mysql-session-handler:
$ composer require janharsa/mysql-session-handler:~1.0
Register an extension in config.neon:
extensions:
sessionHandler: JanHarsa\Session\DI\MysqlSessionHandlerExtension
Default table name is 'sessions'. Can be changeg with adding this on the config.local.neon
sessionHandler:
tableName: session_in_database