Elgg
Version 2.3
|
Public Member Functions | |
__construct (SessionInterface $storage) | |
Constructor. More... | |
start () | |
Start the session. More... | |
migrate ($destroy=false) | |
Migrates the session to a new session id while maintaining session attributes. More... | |
invalidate () | |
Invalidates the session. More... | |
isStarted () | |
Has the session been started. More... | |
getId () | |
Get the session ID. More... | |
setId ($id) | |
Set the session ID. More... | |
getName () | |
Get the session name. More... | |
setName ($name) | |
Set the session name. More... | |
get ($name, $default=null) | |
Get an attribute of the session. More... | |
set ($name, $value) | |
Set an attribute. More... | |
remove ($name) | |
Remove an attribute. More... | |
del ($key) | |
Alias to offsetUnset() More... | |
has ($name) | |
Has the attribute been defined. More... | |
setLoggedInUser (\ElggUser $user) | |
Sets the logged in user. More... | |
getLoggedInUser () | |
Gets the logged in user. More... | |
getLoggedInUserGuid () | |
Return the current logged in user by guid. More... | |
isAdminLoggedIn () | |
Returns whether or not the viewer is currently logged in and an admin user. More... | |
isLoggedIn () | |
Returns whether or not the user is currently logged in. More... | |
removeLoggedInUser () | |
Remove the logged in user. More... | |
getIgnoreAccess () | |
Get current ignore access setting. More... | |
setIgnoreAccess ($ignore=true) | |
Set ignore access. More... | |
get_ignore_access () | |
Alias of getIgnoreAccess() More... | |
set_ignore_access ($ignore=true) | |
Alias of setIgnoreAccess() More... | |
__isset ($key) | |
Test if property is set either as an attribute or metadata. More... | |
offsetSet ($key, $value) | |
Set a value, go straight to session. More... | |
offsetGet ($key) | |
Get a variable from either the session, or if its not in the session attempt to get it from an api call. More... | |
offsetUnset ($key) | |
Unset a value from the cache and the session. More... | |
offsetExists ($offset) | |
Return whether the value is set in either the session or the cache. More... | |
Static Public Member Functions | |
static | getMock () |
Get an isolated ElggSession that does not persist between requests. More... | |
Protected Member Functions | |
generateSessionToken () | |
Adds a token to the session. More... | |
Protected Attributes | |
$storage | |
$logged_in_user | |
$ignore_access = false | |
Definition at line 22 of file ElggSession.php.
ElggSession::__construct | ( | SessionInterface | $storage | ) |
Constructor.
SessionInterface | $storage | The underlying Session implementation private Use elgg_get_session() |
Definition at line 45 of file ElggSession.php.
ElggSession::__isset | ( | $key | ) |
Test if property is set either as an attribute or metadata.
string | $key | The name of the attribute or metadata. |
Definition at line 345 of file ElggSession.php.
ElggSession::del | ( | $key | ) |
Alias to offsetUnset()
string | $key | Name |
Definition at line 181 of file ElggSession.php.
|
protected |
Adds a token to the session.
This is used in creation of CSRF token, and is passed to the client to allow validating tokens later, even if the PHP session was destroyed.
Definition at line 330 of file ElggSession.php.
ElggSession::get | ( | $name, | |
$default = null |
|||
) |
Get an attribute of the session.
string | $name | Name of the attribute to get |
mixed | $default | Value to return if attribute is not set (default is null) |
Definition at line 148 of file ElggSession.php.
ElggSession::get_ignore_access | ( | ) |
ElggSession::getId | ( | ) |
ElggSession::getIgnoreAccess | ( | ) |
ElggSession::getLoggedInUser | ( | ) |
ElggSession::getLoggedInUserGuid | ( | ) |
Return the current logged in user by guid.
Definition at line 229 of file ElggSession.php.
|
static |
Get an isolated ElggSession that does not persist between requests.
Definition at line 463 of file ElggSession.php.
ElggSession::getName | ( | ) |
ElggSession::has | ( | $name | ) |
Has the attribute been defined.
string | $name | Name of the attribute |
Definition at line 193 of file ElggSession.php.
ElggSession::invalidate | ( | ) |
Invalidates the session.
Deletes session data and session persistence. Starts a new session.
Definition at line 81 of file ElggSession.php.
ElggSession::isAdminLoggedIn | ( | ) |
Returns whether or not the viewer is currently logged in and an admin user.
Definition at line 239 of file ElggSession.php.
ElggSession::isLoggedIn | ( | ) |
Returns whether or not the user is currently logged in.
Definition at line 250 of file ElggSession.php.
ElggSession::isStarted | ( | ) |
Has the session been started.
Definition at line 95 of file ElggSession.php.
ElggSession::migrate | ( | $destroy = false | ) |
Migrates the session to a new session id while maintaining session attributes.
boolean | $destroy | Whether to delete the session or let gc handle clean up |
Definition at line 69 of file ElggSession.php.
ElggSession::offsetExists | ( | $offset | ) |
Return whether the value is set in either the session or the cache.
int | $offset | Offset |
Definition at line 438 of file ElggSession.php.
ElggSession::offsetGet | ( | $key | ) |
Get a variable from either the session, or if its not in the session attempt to get it from an api call.
mixed | $key | Name |
Definition at line 376 of file ElggSession.php.
ElggSession::offsetSet | ( | $key, | |
$value | |||
) |
Set a value, go straight to session.
string | $key | Name |
mixed | $value | Value |
Definition at line 360 of file ElggSession.php.
ElggSession::offsetUnset | ( | $key | ) |
Unset a value from the cache and the session.
mixed | $key | Name |
Definition at line 423 of file ElggSession.php.
ElggSession::remove | ( | $name | ) |
Remove an attribute.
string | $name | The name of the attribute to remove |
Definition at line 170 of file ElggSession.php.
ElggSession::removeLoggedInUser | ( | ) |
ElggSession::set | ( | $name, | |
$value | |||
) |
Set an attribute.
string | $name | Name of the attribute to set |
mixed | $value | Value to be set |
Definition at line 159 of file ElggSession.php.
ElggSession::set_ignore_access | ( | $ignore = true | ) |
Alias of setIgnoreAccess()
bool | $ignore | Ignore access |
Definition at line 317 of file ElggSession.php.
ElggSession::setId | ( | $id | ) |
Set the session ID.
string | $id | Session ID |
Definition at line 116 of file ElggSession.php.
ElggSession::setIgnoreAccess | ( | $ignore = true | ) |
Set ignore access.
bool | $ignore | Ignore access |
Definition at line 282 of file ElggSession.php.
ElggSession::setLoggedInUser | ( | \ElggUser | $user | ) |
Sets the logged in user.
\ElggUser | $user | The user who is logged in |
Definition at line 204 of file ElggSession.php.
ElggSession::setName | ( | $name | ) |
Set the session name.
string | $name | Session name |
Definition at line 137 of file ElggSession.php.
ElggSession::start | ( | ) |
Start the session.
RuntimeException | If session fails to start. |
Definition at line 56 of file ElggSession.php.
|
protected |
Definition at line 37 of file ElggSession.php.
|
protected |
Definition at line 32 of file ElggSession.php.
|
protected |
Definition at line 27 of file ElggSession.php.