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;
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'))) {
if(! $collection_name) $id
if($guid==elgg_get_logged_in_user_guid()) $name
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.
invalidate()
Invalidates the session.
getLoggedInUser()
Gets the logged in user.
__isset($key)
Test if property is set either as an attribute or metadata.
setLoggedInUser(ElggUser $user)
Sets the logged in user.
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.
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_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.