pyrsmk/session

This package is abandoned and no longer maintained. No replacement package was suggested.

A simple session manager

Installs: 173

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

0.2.2 2016-10-06 16:12 UTC

This package is auto-updated.

Last update: 2020-08-29 17:22:16 UTC


README

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.