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;
214 $this->loggedInUser = null;
215 $this->
remove(
'guid');
227 if (!$this->
has(
'__elgg_session')) {
228 $this->
set(
'__elgg_session', md5(microtime() . rand()));
274 if (in_array(
$key, array(
'user',
'id',
'name',
'username'))) {
276 if ($this->loggedInUser) {
282 return $this->loggedInUser->guid;
286 return $this->loggedInUser->$key;
295 return $this->
get(
$key);
300 if ($orig_value !==
$value) {
336 if (in_array(
$offset, array(
'user',
'id',
'name',
'username'))) {
setId($id)
Set the session ID.
setName($name)
Set the session name.
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.
removeLoggedInUser()
Remove the logged in user.
invalidate()
Invalidates the session.
isStarted()
Has the session been started.
getId()
Get the session ID.
start()
Start the session.
del($key)
Alias to offsetUnset()
getLoggedInUser()
Gets the logged in 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...
setLoggedInUser(ElggUser $user)
Sets the logged in user.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Trigger a Plugin Hook and run all handler callbacks registered to that hook:type. ...
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.
__construct(Elgg_Http_SessionStorage $storage)
Constructor.
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.