$this->savePath = $savePath;
}
+ /**
+ * Initialize XSRF token and links per page session variables.
+ */
+ public function initialize(): void
+ {
+ if (!isset($this->session['tokens'])) {
+ $this->session['tokens'] = [];
+ }
+
+ if (!isset($this->session['LINKS_PER_PAGE'])) {
+ $this->session['LINKS_PER_PAGE'] = $this->conf->get('general.links_per_page', 20);
+ }
+ }
+
/**
* Define whether the user should stay signed in across browser sessions
*
unset($this->session['expires_on']);
unset($this->session['username']);
unset($this->session['visibility']);
- unset($this->session['untaggedonly']);
}
}
return session_start();
}
- public function cookieParameters(int $lifeTime, string $path, string $domain): bool
+ /**
+ * Be careful, return type of session_set_cookie_params() changed between PHP 7.1 and 7.2.
+ */
+ public function cookieParameters(int $lifeTime, string $path, string $domain): void
{
- return session_set_cookie_params($lifeTime, $path, $domain);
+ session_set_cookie_params($lifeTime, $path, $domain);
}
public function regenerateId(bool $deleteOldSession = false): bool