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 3w 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

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198741.5k12](/packages/pgvector-pgvector)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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