https://github.com/photon/session-mongodb
MongoDB backend for session storage
https://github.com/photon/session-mongodb
Last synced: about 1 year ago
JSON representation
MongoDB backend for session storage
- Host: GitHub
- URL: https://github.com/photon/session-mongodb
- Owner: photon
- License: lgpl-2.1
- Created: 2014-08-05T16:45:43.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-12-04T16:39:19.000Z (over 8 years ago)
- Last Synced: 2025-02-08T14:11:18.126Z (over 1 year ago)
- Language: PHP
- Size: 31.3 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
session-mongodb
===============
[](https://travis-ci.org/photon/session-mongodb)
MongoDB backend for session storage
PHP Versions
------------
- 7.0 and 7.1 are supported and tested under travis
- Use ext-mongodb and mongodb/mongodb. Do not works anymore with legacy ext-mongo
Quick start
-----------
1) Add the module in your project
composer require "photon/session-mongodb"
or for a specific version
composer require "photon/session-mongodb:2.0.0"
2) Define a MongoDB connection in your project configuration
'databases' => array(
'session-db' => array(
'engine' => '\photon\db\MongoDB',
'server' => 'mongodb://localhost:27017/',
'database' => 'sessions',
'options' => array(
'connect' => true,
),
),
),
3) Define the session storage backend in your project configuration, and some others session parameters
'session_storage' => '\photon\session\storage\MongoDB',
'session_cookie_domain' => 'www.example.com',
'session_cookie_path' => '/',
'session_timeout' => 4 * 3600,
4) Define the configuration of the MongoDB Session module in your project configuration
'session_mongodb' => array(
'database' => 'session-db',
'collection' => 'session',
),
5) Enjoy !