A simple session manager
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitattributes
.gitignore
LICENSE.txt
README.md
Session.php
composer.json
gulpfile.js
package.json

README.md

Session 0.2.2

A simple session manager based on Chernozem.

Install

Pick up the source or install it with Composer :

composer require pyrsmk/session

If you're not installing it with Composer, don't forget to load its dependencies too : Chernozem.

Managing session variables

As mentioned above, this library is based on Chernozem. Therefore, its use is pretty simple :

// Create the session object
$session = new Session();
// Define a session variable
$session['user_id'] = $user_id;
// Print a previously defined session variable
echo $session['user_id'];
// Remove a variable
unset($session['user_id']);

If needed, you can add a namespace to your session by specifying it at instantiation :

$session = new Session('my_namespace');

License

Session is released under the MIT license.