summaryrefslogtreecommitdiff
path: root/lib/alert.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-12-11 00:20:43 +0500
committerilotterytea <iltsu@alright.party>2025-12-11 00:20:43 +0500
commit7e413a5d37346ec9512dca230f635dd57f1798e6 (patch)
tree4ac0b0f9fa9d4be590d3f192c701a0136df9d0f4 /lib/alert.php
parent6527c452e1a48f52afea00ad82507fe8a02bd5ea (diff)
upd: check if session exists
Diffstat (limited to 'lib/alert.php')
-rw-r--r--lib/alert.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/alert.php b/lib/alert.php
index 300d58c..97cb302 100644
--- a/lib/alert.php
+++ b/lib/alert.php
@@ -11,7 +11,8 @@ function generate_alert(string $path, string $error, int $status = 400)
"data" => null
]);
} else {
- session_start();
+ if (session_status() != PHP_SESSION_ACTIVE)
+ session_start();
$_SESSION['alert'] = [
'code' => $status,
'reason' => $error