PHPackages                             jayc89/php-sql-session-handler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. jayc89/php-sql-session-handler

Abandoned → [https://github.com/jayc89/PHP-MySQL-Session-Handler](/?search=https%3A%2F%2Fgithub.com%2Fjayc89%2FPHP-MySQL-Session-Handler)Library[Database &amp; ORM](/categories/database)

jayc89/php-sql-session-handler
==============================

085PHP

Since Jan 27Pushed 11y ago1 watchersCompare

[ Source](https://github.com/jayc89/PHP-SQL-Session-Handler)[ Packagist](https://packagist.org/packages/jayc89/php-sql-session-handler)[ RSS](/packages/jayc89-php-sql-session-handler/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#Deprecated, please use [PHP-MySQL-Session-Handler](https://github.com/jayc89/PHP-MySQL-Session-Handler)

PHP SQL Session Handler
=======================

[](#php-sql-session-handler)

SQLSessionHandler is a PHP MySQL Session Handler written for use with [PHP-MySQL-PDO-Database-Class](https://github.com/jayc89/php-mysql-pdo-database-class)

Installation
------------

[](#installation)

```
composer install jayc89/php-sql-session-handler
```

Configuration
-------------

[](#configuration)

```
CREATE TABLE `session_handler` (
    `id` varchar(255) NOT NULL,
    `data` mediumtext NOT NULL,
    `timestamp` int(255) NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```

```
require 'vendor/autoload.php';

$session = new SQLSessionHandler();

// add db data
$session->setDbDetails('localhost', 'username', 'password', 'database');
// OR alternatively send a MySQLi resource
// $db = new Db(); // https://github.com/jayc89/php-mysql-pdo-database-class
// $session->setDbConnection($db);

$session->setDbTable('session_handler');
session_set_save_handler(array($session, 'open'),
                         array($session, 'close'),
                         array($session, 'read'),
                         array($session, 'write'),
                         array($session, 'destroy'),
                         array($session, 'gc'));

register_shutdown_function('session_write_close');
session_start();
```

License
-------

[](#license)

MIT

**Free Software, Hell Yeah!**

Credits
-------

[](#credits)

sprainr -

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d11f2e76de7ba7b3ebe3df115f6e81842fb6b7f0896189c53f2116fd3f35e3c?d=identicon)[jayc89](/maintainers/jayc89)

### Embed Badge

![Health badge](/badges/jayc89-php-sql-session-handler/health.svg)

```
[![Health](https://phpackages.com/badges/jayc89-php-sql-session-handler/health.svg)](https://phpackages.com/packages/jayc89-php-sql-session-handler)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
