PHPackages                             micheledef/pdo-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. micheledef/pdo-session-handler

ActiveLibrary[Database &amp; ORM](/categories/database)

micheledef/pdo-session-handler
==============================

Store data in a database using PDO and the SessionHandlerInterface interface

v1.0.0(3y ago)160↓100%MITPHPPHP &gt;=7.2

Since Mar 13Pushed 2y ago1 watchersCompare

[ Source](https://github.com/MicheleDeF/PDOSessionHandler)[ Packagist](https://packagist.org/packages/micheledef/pdo-session-handler)[ RSS](/packages/micheledef-pdo-session-handler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

PDOSessionHandler
=================

[](#pdosessionhandler)

Store session data in a database using PDO and the SessionHandlerInterface interface

Install via Composer
--------------------

[](#install-via-composer)

```
composer require micheledef/pdo-session-handler
```

Create session table

```
CREATE TABLE session (
`id` varchar(256) NOT NULL,
`name` varchar(256) NOT NULL,
`value` longtext,
`last_update` int(11) NOT NULL,
PRIMARY KEY (`id`,`name`) ) ENGINE = INNODB;
```

To use the PDOSessionHandler session handler it is necessary to use the session\_set\_save\_handler() function which accepts as an input parameter a class that implements the SessionHandlerInterface interface, so in our case we will proceed as follows

Quick Start
-----------

[](#quick-start)

```
