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);
137 return $this->storage->get(
$name, $default);
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'))) {
setId($id)
Set the session ID.
setName($name)
Set the session name.
setLoggedInUser(\ElggUser $user)
Sets the logged in user.
has($name)
Has the attribute been defined.
offsetUnset($key)
Unset a value from the cache and the session.
if($guid==elgg_get_logged_in_user_guid()) $name
generateSessionToken()
Adds a token to the session.
migrate($destroy=false)
Migrates the session to a new session id while maintaining session attributes.
getName()
Get the session name.
isLoggedIn()
Returns whether or not the user is currently logged in.
removeLoggedInUser()
Remove the logged in user.
invalidate()
Invalidates the session.
if(!$autoload_available) _elgg_services()
isStarted()
Has the session been started.
getId()
Get the session ID.
start()
Start the session.
getLoggedInUserGuid()
Return the current logged in user by guid.
del($key)
Alias to offsetUnset()
getLoggedInUser()
Gets the logged in user.
isAdminLoggedIn()
Returns whether or not the viewer is currently logged in and an admin user.
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.
__isset($key)
Test if property is set either as an attribute or metadata.
if(!$collection_name) $id
offsetExists($offset)
Return whether the value is set in either the session or the cache.
offsetSet($key, $value)
Set a value, go straight to session.
__construct(\Elgg\Http\SessionStorage $storage)
Constructor.