aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/security
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-07-21 20:33:33 +0200
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commita8c11451e8d885a243c1ad52012093ba8d121e2c (patch)
tree19caf0ed75f5b26c34f3f979f2b95d3f1232dbae /application/security
parentc4ad3d4f061d05a01db25aa54dda830ba776792d (diff)
downloadShaarli-a8c11451e8d885a243c1ad52012093ba8d121e2c.tar.gz
Shaarli-a8c11451e8d885a243c1ad52012093ba8d121e2c.tar.zst
Shaarli-a8c11451e8d885a243c1ad52012093ba8d121e2c.zip
Process login through Slim controller
Diffstat (limited to 'application/security')
-rw-r--r--application/security/SessionManager.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/application/security/SessionManager.php b/application/security/SessionManager.php
index 82771c24..46219a3d 100644
--- a/application/security/SessionManager.php
+++ b/application/security/SessionManager.php
@@ -259,4 +259,34 @@ class SessionManager
259 { 259 {
260 return $this->savePath; 260 return $this->savePath;
261 } 261 }
262
263 /*
264 * Next public functions wrapping native PHP session API.
265 */
266
267 public function destroy(): bool
268 {
269 $this->session = [];
270
271 return session_destroy();
272 }
273
274 public function start(): bool
275 {
276 if (session_status() === PHP_SESSION_ACTIVE) {
277 $this->destroy();
278 }
279
280 return session_start();
281 }
282
283 public function cookieParameters(int $lifeTime, string $path, string $domain): bool
284 {
285 return session_set_cookie_params($lifeTime, $path, $domain);
286 }
287
288 public function regenerateId(bool $deleteOldSession = false): bool
289 {
290 return session_regenerate_id($deleteOldSession);
291 }
262} 292}