50 $migrate_session =
false;
53 if ($this->
has(
'guid')) {
67 $migrate_session =
true;
73 $user->setLastAction();
76 if (
$user->isBanned()) {
93 if ($this->storage->getId()) {
97 $result = $this->storage->start();
109 public function migrate(
bool $destroy =
true) {
110 return $this->storage->migrate($destroy);
122 $this->storage->clear();
136 $this->storage->save();
146 return $this->storage->isStarted();
156 return $this->storage->getId();
167 $this->storage->setId(
$id);
177 return $this->storage->getName();
188 $this->storage->setName(
$name);
199 return $this->storage->get(
$name, $default);
221 return $this->storage->remove(
$name);
232 return $this->storage->has(
$name);
245 if (!$this->
has(
'__elgg_session')) {
246 $this->
set(
'__elgg_session',
_elgg_services()->crypto->getRandomString(22));
258 $storage =
new MockArraySessionStorage();
278 'cache_limiter' => session_cache_limiter(),
281 'cookie_path' =>
$params[
'path'],
282 'cookie_domain' =>
$params[
'domain'],
283 'cookie_secure' =>
$params[
'secure'],
284 'cookie_httponly' =>
$params[
'httponly'],
285 'cookie_lifetime' =>
$params[
'lifetime'],
286 'cookie_samesite' =>
$params[
'samesite'],
289 $handler =
new ElggSessionHandler($db);
309 'cache_limiter' => session_cache_limiter(),
312 'cookie_path' =>
$params[
'path'],
313 'cookie_domain' =>
$params[
'domain'],
314 'cookie_secure' =>
$params[
'secure'],
315 'cookie_httponly' =>
$params[
'httponly'],
316 'cookie_lifetime' =>
$params[
'lifetime'],
setId($id)
Set the session ID.
trait Profilable
Make an object accept a timer.
setName($name)
Set the session name.
has($name)
Has the attribute been defined.
save()
Save the session data and closes the session.
$params
Saves global plugin settings.
if(!$user||!$user->canDelete()) $name
generateSessionToken()
Adds a token to the session.
getName()
Get the session name.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
invalidate()
Invalidates the session.
static fromFiles(Config $config)
Create a session stored in files.
isStarted()
Has the session been started.
start()
Start the session.
$config
Advanced site settings, debugging section.
if($who_can_change_language=== 'nobody') elseif($who_can_change_language=== 'admin_only'&&!elgg_is_admin_logged_in()) $options
foreach($recommendedExtensions as $extension) if(empty(ini_get('session.gc_probability'))||empty(ini_get('session.gc_divisor'))) $db
getID()
Get the session ID.
__construct(SessionInterface $storage)
Constructor.
if(isset($_COOKIE['elggperm'])) $session
getCookieConfig()
Set up and return the cookie configuration array resolved from settings.
beginTimer(array $keys)
Start the timer (when enabled)
migrate(bool $destroy=true)
Migrates the session to a new session id while maintaining session attributes.
Database session handler.
_elgg_services()
Get the global service provider.
static getMock()
Get an isolated ElggSession that does not persist between requests.
boot()
Initializes the session and checks for the remember me cookie.
$id
Generic annotation delete action.
endTimer(array $keys)
Ends the timer (when enabled)
static fromDatabase(Config $config, Database $db)
Create a session stored in the DB.