Custom PHP session handler for Nette Framework that uses MySQL database for storage.
- PHP 8.1+
Preferred way to install pematon/mysql-session-handler is by using Composer:
$ composer require pematon/mysql-session-handler:~2.0After installation:
-
Create the table
sessionusing SQL in sql/create.sql. -
Register an extension in config.neon:
extensions:
sessionHandler: Pematon\Session\DI\MysqlSessionHandlerExtension- Configure custom table name:
sessionHandler:
tableName: session- For security reasons, Session ID is stored in the database as an MD5 hash.
- Multi-Master Replication friendly (tested in Master-Master row-based replication setup).