/**
* Gets an attribute by key.
*
* @param string $key The key name.
*
* @return mixed|null Should return null if the key is not found.
*/
public function get(string $key)
Examples
$result = $session->get('foo');
Getting Started
Methods
- all Gets all session values as array.
- close Force the session to be saved and closed. Session data is usually stored after your script terminated without the need to call close(), but as session data is locked to prevent concurrent writes only one script may operate on a session at any time. When using framesets together with sessions you will experience the frames loading one by one due to this locking. You can reduce the time needed to load all the frames by ending the session as soon as all changes to session variables are done.
- delete Deletes an attribute by key.
- destroy Deletes an attribute by key.
- flush Flush all session data.
- get Gets an attribute by key.
- getCookieParams Get cookie parameters.
- getId Returns the session ID.
- getName Returns the session name.
- getOptions Get session runtime configuration.
- has Returns true if the key exists.
- isStarted Checks if the session was started.
- pull Gets an session attribute by key and remove it.
- regenerateId Regenerates the session ID
- set Sets an session attribute by key.
- setCookieParams Set cookie parameters.
- setId Sets the session ID.
- setOptions Set session runtime configuration.
- start Starts the session.