$session→setFor()  
Set a session variable within a given namespace
To remove a namespace, use $session->remove($namespace).
Example
// Set a session value for a namespace
$session->setFor($this, 'firstName', 'Bob'); Usage
$session->setFor($ns, string $key, mixed $value);Arguments
| Name | Type(s) | Description | 
|---|---|---|
| $ns | stringobject | Namespace string or object. | 
| $key | string | Name of session variable you want to set. | 
| $value | mixed | Value you want to set, or specify null to unset. | 
Return value
$thisObject instance it was called from (method supports fluent interface).
$session methods and properties
API reference based on ProcessWire core version 3.0.252