BrSession helper to work with session

extends BrObject

Helper to work with session.

There is one global config object (singleton) accessible via br()->session(). You can still create own configuration storage if required by $session = new BrSession();

Object members

Method/property Description
If you are using global config, please prepend below methods with br()->session()->
set(name, value) Set session value. Value could be scalar or array.
get() Get all session values
get(name, defaultValue)

Get session value or default value for this name. Name could be array path. For example:

br()->session()->set('SomeStructuredSetting', array('name' => 'SomeName'));



If you are working with global session object you can use br()->session(name, defaultValue) instead of br()->session()->get(name, defaultValue) for simplicity.