34 $this->loggedInUser =
null;
45 $result = $this->storage->start();
57 public function migrate($destroy =
false) {
58 return $this->storage->regenerate($destroy);
70 $this->storage->clear();
71 $this->loggedInUser =
null;
84 return $this->storage->isStarted();
94 return $this->storage->getId();
105 $this->storage->setId(
$id);
115 return $this->storage->getName();
126 $this->storage->setName(
$name);
159 return $this->storage->remove(
$name);
182 return $this->storage->has(
$name);
193 $this->
set(
'guid', $user->guid);
194 $this->loggedInUser =
$user;
249 $this->loggedInUser =
null;
250 $this->
remove(
'guid');
262 if (!$this->
has(
'__elgg_session')) {
263 $this->
set(
'__elgg_session', md5(microtime() . rand()));
309 if (in_array(
$key, array(
'user',
'id',
'name',
'username'))) {
311 if ($this->loggedInUser) {
317 return $this->loggedInUser->guid;
321 return $this->loggedInUser->$key;
330 return $this->
get(
$key);
335 if ($orig_value !==
$value) {
371 if (in_array(
$offset, array(
'user',
'id',
'name',
'username'))) {
if(! $collection_name) $id
if($guid==elgg_get_logged_in_user_guid()) $name
if(! $autoload_available) _elgg_services()
offsetUnset($key)
Unset a value from the cache and the session.
migrate($destroy=false)
Migrates the session to a new session id while maintaining session attributes.
offsetSet($key, $value)
Set a value, go straight to session.
has($name)
Has the attribute been defined.
setLoggedInUser(\ElggUser $user)
Sets the logged in user.
invalidate()
Invalidates the session.
getLoggedInUser()
Gets the logged in user.
isLoggedIn()
Returns whether or not the user is currently logged in.
__isset($key)
Test if property is set either as an attribute or metadata.
generateSessionToken()
Adds a token to the session.
offsetExists($offset)
Return whether the value is set in either the session or the cache.
getId()
Get the session ID.
del($key)
Alias to offsetUnset()
__construct(\Elgg\Http\SessionStorage $storage)
Constructor.
setId($id)
Set the session ID.
removeLoggedInUser()
Remove the logged in user.
isStarted()
Has the session been started.
isAdminLoggedIn()
Returns whether or not the viewer is currently logged in and an admin user.
getLoggedInUserGuid()
Return the current logged in user by guid.
start()
Start the session.
getName()
Get the session name.
setName($name)
Set the session name.
offsetGet($key)
Get a variable from either the session, or if its not in the session attempt to get it from an api ca...
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Sends a notice about deprecated use of a function, view, etc.