nehalvpatel / synapse
This package is abandoned and no longer maintained.
No replacement package was suggested.
Synapse saves sessions to the database
1.0.1
2014-03-19 23:47 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
- squizlabs/php_codesniffer: 1.*
This package is not auto-updated.
Last update: 2022-02-01 12:32:44 UTC
README
Synapse saves sessions to the database.
Requirements
- PHP 5.4 and up
- MySQL
Getting Started
- Install composer
- Add the package to your composer.json
- Run composer
Example
- Pass a PDO object to the handler class (a table called "sessions" will be auto generated)
- Set the save handler to use the class
- Start the session
require 'vendor/autoload.php'; $Synapse = new \Synapse\Handler(new PDO("mysql:host=" . $db_host . ";dbname=" . $db_name, $db_username, $db_password)); session_set_save_handler($Synapse, true); session_start(); $_SESSION["user_id"] = "1";