PHPackages                             mdbsh/mdbsh - 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. mdbsh/mdbsh

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

mdbsh/mdbsh
===========

MongoDB Session Handler

1.0.0(9y ago)04MITPHPPHP &gt;=7.0

Since Sep 9Pushed 9y agoCompare

[ Source](https://github.com/subversivo58/mdbsh)[ Packagist](https://packagist.org/packages/mdbsh/mdbsh)[ Docs](https://github.com/subversivo58/mdbsh)[ RSS](/packages/mdbsh-mdbsh/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

MongoDB Session Handler
=======================

[](#mongodb-session-handler)

### Description:

[](#description)

Store, retrieve `PHP` sessions in **MongoDB** database

### Features:

[](#features)

> PSR-4 compatible (like `Composer` as autoload)
>
> force-garbage (immediately remove expired sessions)
>
> token to access in another server|services|...
>
> crypto function. Thanks Enrico Zimuel

### Requeriments:

[](#requeriments)

- [PHP 7.0](http://php.net/downloads.php) (minimum version required)
- [Composer](https://getcomposer.org/download/) on your system
- [MongoDB database](https://www.mongodb.com/download-center#community) on your system
- [MongoDB PHP Driver](https://github.com/mongodb/mongo-php-driver) on your `/ext` path of extensions and directive on your `php.ini` file e.g: **php\_extension=mongodb.so** (Linux) or **php\_extension=ongodb.dll** (Windows)
- [see on Pelc for manually download extensions](https://pecl.php.net/package/mongodb) \[recomended version 1.1.7\]
- [MongoDB PHP Library](https://github.com/mongodb/mongo-php-library) for **CRUD** operations \[installed by default\]

> Requeriments for encrypt | decrypt session data:
>
> - [OpenSSL](https://www.openssl.org/) in your system (most Linux systems come with pre-installed SSL)

- in their PHP configuration file (php.ini) uncomment line **extension=php\_openssl.so** (Linux) or **extension=php\_openssl.dll** (Windows)

> - **mbstring**

- in their PHP configuration file (php.ini) uncomment line **extension=php\_mbstring.so** (Linux) or **extension=php\_mbstring.dll** (Windows)

---

### Install:

[](#install)

**Soft Way:**

> **step 1**: If you already have `Composer` on your project (and know how to use it):

```
composer require "mdbsh/mdbsh": "^1.0"

```

> **step 2**: Case no have `Composer`... [download](https://getcomposer.org/download/), after open|create the path of your project and inside, run `ComandLineTool` for use `Composer` to install... recalls from step 1? Up ;)

**Hard Way:**

> Download this repository **.zip** archive (or clone for your machine), unzip this content into your path of project, download manually dependencies, create (or incorporate) this class to your personal "autoload" or use the old method ¬¬

```
   require 'path/file.php';
```

---

### How to use:

[](#how-to-use)

Define options (**optional**) instance on top of script example using `Composer`:

```
