Skip to content

gobline/session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Session component

Gobline\Session\NamespacedSession allows to segregate all session data into different namespaces. A default namespace exists for those who only want one namespace for all their session data.

Usage

$session = new Gobline\Session\NamespacedSession('MyNamespace');

$session->set('foo', 'bar');

$session->get('foo'); // returns "bar"

$session->get('corge'); // "corge" not found, throws \InvalidArgumentException

$session->get('corge', 'grault'); // "corge" not found, returns default "grault" value

$session->remove('foo');

$session->clearAll(); // removes all session variables from "MyNamespace" namespace

$session->setNamespace('AnotherNamespace'); // switch namespace

Installation

You can install the Session component using the dependency management tool Composer. Run the require command to resolve and download the dependencies:

composer require gobline/session

About

Segregate all session data into different namespaces

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages