]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/security/SessionManager.php
Process login through Slim controller
[github/shaarli/Shaarli.git] / application / security / SessionManager.php
index 82771c248cddce08277baa26556e83ea2b835bb2..46219a3dee46ae13cf0603492cffed4c73e53df1 100644 (file)
@@ -259,4 +259,34 @@ class SessionManager
     {
         return $this->savePath;
     }
+
+    /*
+     * Next public functions wrapping native PHP session API.
+     */
+
+    public function destroy(): bool
+    {
+        $this->session = [];
+
+        return session_destroy();
+    }
+
+    public function start(): bool
+    {
+        if (session_status() === PHP_SESSION_ACTIVE) {
+            $this->destroy();
+        }
+
+        return session_start();
+    }
+
+    public function cookieParameters(int $lifeTime, string $path, string $domain): bool
+    {
+        return session_set_cookie_params($lifeTime, $path, $domain);
+    }
+
+    public function regenerateId(bool $deleteOldSession = false): bool
+    {
+        return session_regenerate_id($deleteOldSession);
+    }
 }