aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/security
diff options
context:
space:
mode:
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}