$init
$init : boolean
A non-blocking session manager.
$cookie : \duncan3dc\Sessions\Cookie
getSet(string $key, mixed $default = null, boolean $strict = false) : mixed
This is a convenience method to prevent having to do several checks/set for all persistant variables.
If the key name has been passed via POST then that value is stored in the session and returned. If the key name has been passed via GET then that value is stored in the session and returned. If there is already a value in the session data then that is returned. If all else fails then the default value is returned. All checks are truthy/falsy (so a POST value of "0" is ignored), unless the 3rd parameter is set to true.
string | $key | The name of the key to retrieve from session data |
mixed | $default | The value to use if the current session value is falsy |
boolean | $strict | Whether to do strict comparisons or not |
__construct(string $name, \duncan3dc\Sessions\Cookie $cookie = null, string $id = "")
Create a new instance.
string | $name | The name of the session |
\duncan3dc\Sessions\Cookie | $cookie | The cookie settings to use |
string | $id | The session ID to use |
createNamespace(string $name) : \duncan3dc\Sessions\SessionNamespace
Create a new namespaced section of this session to avoid clashes.
string | $name | The namespace of the session |