pyrsmk / session
A simple session manager
Installs: 173
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
Requires
- php: >=5.3.0
- pyrsmk/chernozem: ^4.2
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.