2017 © Pedro Peláez
 

library mongodb-session-handler

A session handler that stores structured data in MongoDB

image

legalthings/mongodb-session-handler

A session handler that stores structured data in MongoDB

  • Thursday, May 31, 2018
  • by jasny
  • Repository
  • 6 Watchers
  • 1 Stars
  • 3,687 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 5 Versions
  • 8 % Grown

The README.md

MongoDB session handler

Build Status Code Coverage Scrutinizer Code Quality, (*1)

The LegalThings MongoDB session handler stores sessions as structured data in MongoDB. This allows a process to fetch and modify or remove a session based on its data., (*2)

Use cases

Remove user sessions when a password changes

When you change your password, you want to remove all the other sessions of the user. This is a security measure, the old password may be comprimised and a hacker may already have logged in. Without invalidating his session, he can continue to use the user account even after the password has changed., (*3)

Cache and update user information

For performance reasons you might store the user's information like name, image, team name, etc in the session. When a team changes it's name, you want to find all the sessions of the users within that team and update the information., (*4)

Installation

composer require legalthings/mongodb-session-handler

This libary uses the legacy Mongo driver. If you're running PHP7 or simply are already using the new MongoDB driver, please install alcaeus/mongo-php-adapter., (*5)

Usage

$mongo = new MongoClient();
$collection = $mongo->some_db->sessions;
$handler = new MongodbSessionHandler($collection);

session_set_save_handler($handler);

To create read-only sessions use new MongodbSessionHandler($collection, 'r'), (*6)

The Versions

31/05 2018

dev-master

9999999-dev

A session handler that stores structured data in MongoDB

  Sources   Download

MIT

The Requires

 

The Development Requires

31/05 2018

v2.0.0

2.0.0.0

A session handler that stores structured data in MongoDB

  Sources   Download

MIT

The Requires

 

The Development Requires

31/05 2018

dev-php7

dev-php7

A session handler that stores structured data in MongoDB

  Sources   Download

MIT

The Requires

 

The Development Requires

10/10 2016

v1.0.1

1.0.1.0

A session handler that stores structured data in MongoDB

  Sources   Download

MIT

The Requires

 

The Development Requires

08/10 2016

v1.0.0

1.0.0.0

A session handler that stores structured data in MongoDB

  Sources   Download

MIT

The Requires

 

The Development Requires