Unset a session variable
Example
// Unset a session var
$session->remove('firstName');
// Unset a session var in a namespace
$session->remove($this, 'firstName');
// Unset all session vars in a namespace
$session->remove($this, true);
Usage
// basic usage
$session->remove($key);
// usage with all arguments
$session->remove($key, $_key = null);
Arguments
Name | Type(s) | Description |
---|---|---|
key | string, object | Name of session variable you want to remove (or namespace string/object) |
_key (optional) | string, bool, null | Omit this argument unless first argument is a namespace. Otherwise specify one of:
|
Return value
$this
Object instance it was called from (method supports fluent interface).
$session methods and properties
API reference based on ProcessWire core version 3.0.236