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

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

  1. Install composer
  2. Add the package to your composer.json
  3. Run composer

Example

  1. Pass a PDO object to the handler class (a table called "sessions" will be auto generated)
  2. Set the save handler to use the class
  3. 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";