createNamespace()
createNamespace(string $name) : \duncan3dc\Sessions\SessionNamespace
Create a new namespaced section of this session to avoid clashes.
Parameters
string | $name | The namespace of the session |
A generic interface for session managers.
createNamespace(string $name) : \duncan3dc\Sessions\SessionNamespace
Create a new namespaced section of this session to avoid clashes.
string | $name | The namespace of the session |
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 |