|
Elgg
Version 1.10
|
Public Member Functions | |
| start () | |
| Starts the session. More... | |
| isStarted () | |
| Checks if the session is started. More... | |
| getId () | |
| Returns the session ID. More... | |
| setId ($id) | |
| Sets the session ID. More... | |
| getName () | |
| Returns the session name. More... | |
| setName ($name) | |
| Sets the session name. More... | |
| regenerate ($destroy=false, $lifetime=null) | |
| Regenerates id that represents this storage. More... | |
| save () | |
| Force the session to be saved and closed. More... | |
| has ($name) | |
| Checks if an attribute is defined. More... | |
| get ($name, $default=null) | |
| Returns an attribute. More... | |
| set ($name, $value) | |
| Sets an attribute. More... | |
| all () | |
| Returns all attributes. More... | |
| replace (array $attributes) | |
| Replaces all attributes. More... | |
| remove ($name) | |
| Removes an attribute. More... | |
| clear () | |
| Clears all attributes. More... | |
Definition at line 36 of file SessionStorage.php.
| Elgg\Http\SessionStorage::all | ( | ) |
Returns all attributes.
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::clear | ( | ) |
Clears all attributes.
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::get | ( | $name, | |
$default = null |
|||
| ) |
Returns an attribute.
| string | $name | The attribute name |
| mixed | $default | The default value if not found. |
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::getId | ( | ) |
Returns the session ID.
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::getName | ( | ) |
Returns the session name.
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::has | ( | $name | ) |
Checks if an attribute is defined.
| string | $name | The attribute name |
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::isStarted | ( | ) |
Checks if the session is started.
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::regenerate | ( | $destroy = false, |
|
$lifetime = null |
|||
| ) |
Regenerates id that represents this storage.
This method must invoke session_regenerate_id($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing.
Note regenerate+destroy should not clear the session data in memory only delete the session data from persistent storage.
| boolean | $destroy | Destroy session when regenerating? |
| integer | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. |
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::remove | ( | $name | ) |
Removes an attribute.
| string | $name | Attribute name |
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::replace | ( | array | $attributes | ) |
Replaces all attributes.
| array | $attributes | Attributes |
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::save | ( | ) |
Force the session to be saved and closed.
This method must invoke session_write_close() unless this interface is used for a storage object design for unit or functional testing where a real PHP session would interfere with testing, in which case it it should actually persist the session data if required.
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::set | ( | $name, | |
| $value | |||
| ) |
Sets an attribute.
| string | $name | Attribute name |
| mixed | $value | Attribute value |
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::setId | ( | $id | ) |
Sets the session ID.
| string | $id | Session string |
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::setName | ( | $name | ) |
Sets the session name.
| string | $name | Session name. |
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.
| Elgg\Http\SessionStorage::start | ( | ) |
Starts the session.
Implemented in Elgg\Http\NativeSessionStorage, and Elgg\Http\MockSessionStorage.