pematon / mysql-session-handler
MySQL session handler for Nette Framework
v2.0.0
2023-04-18 12:20 UTC
Requires
- php: >=8.1
- nette/database: ^3.1.4
- nette/di: ^3.0.9
This package is not auto-updated.
Last update: 2025-04-12 19:16:12 UTC
README
Custom PHP session handler for Nette Framework that uses MySQL database for storage.
Requirements
- PHP 8.1+
Installation
Preferred way to install pematon/mysql-session-handler is by using Composer:
$ composer require pematon/mysql-session-handler:~2.0
Setup
After installation:
-
Create the table
session
using SQL in sql/create.sql. -
Register an extension in config.neon:
extensions: sessionHandler: Pematon\Session\DI\MysqlSessionHandlerExtension
- Configure custom table name:
sessionHandler: tableName: session
Features
- 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).