|
pclib
3.3.0
Lightweight PHP framework
|
Get or set application session variables. More...
Public Member Functions | |
| __construct ($section='') | |
| Create sesion object. More... | |
| setOptions (array $options) | |
| Setup session options ie. More... | |
| setLifeTime ($seconds) | |
| Set session lifetime in seconds. More... | |
| start () | |
| Start session with security aware presets. | |
| get ($key, $default=null) | |
| Get session variable - you can use dot notation 'group.variable'. More... | |
| set ($key, $value) | |
| Set session variable - you can use dot notation 'group.variable'. More... | |
| delete ($key=null) | |
| Delete session variable. More... | |
| destroy () | |
| Destroy whole session including session cookie. | |
Data Fields | |
| $autoStart = false | |
| Start session at first use. | |
| $id | |
| Session id. | |
Get or set application session variables.
Example: $key = $app->session->get('some.key'); $app->session->set('some.key', 'value');
| __construct | ( | $section = '' | ) |
Create sesion object.
| string | $section | All variables will be stored in $_SESSION[$section]. |
| delete | ( | $key = null | ) |
Delete session variable.
| string | $key | Variable name |
| get | ( | $key, | |
$default = null |
|||
| ) |
Get session variable - you can use dot notation 'group.variable'.
Throws exception when session is not initialized and $default is not set.
| string | $key | Variable name |
| mixed | $default | Default value |
| set | ( | $key, | |
| $value | |||
| ) |
Set session variable - you can use dot notation 'group.variable'.
Throws exception when session is not initialized.
| string | $key | Variable name |
| mixed | $value | Variable value |
| setLifeTime | ( | $seconds | ) |
Set session lifetime in seconds.
| int | $seconds |
| setOptions | ( | array | $options | ) |
Setup session options ie.
session_start() parameters.
| array | $options | See session_start() |