$session->get()
Returns one or all session values by key
$session->get(string|null $key = null, mixed $default = null): mixed
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $key | stringornull |
null
|
The key to get or null for the entire data array |
| $default | mixed |
null
|
Optional default value to return if the key is not defined |
Return type
mixed
This method modifies the existing $sessiondata object it is applied to and returns it again.