summaryrefslogtreecommitdiffstats
path: root/modules-available/session
diff options
context:
space:
mode:
authorSimon Rettberg2021-05-04 17:32:26 +0200
committerSimon Rettberg2021-05-11 14:50:11 +0200
commit1e8329986ef4d06a9bb7550e24f4dacc7715fb5b (patch)
tree67e13b41650992d2266d42c88b91489a65840eae /modules-available/session
parent[systemstatus] Fix displaying VM store usage if using internal storage (diff)
downloadslx-admin-1e8329986ef4d06a9bb7550e24f4dacc7715fb5b.tar.gz
slx-admin-1e8329986ef4d06a9bb7550e24f4dacc7715fb5b.tar.xz
slx-admin-1e8329986ef4d06a9bb7550e24f4dacc7715fb5b.zip
[main+Session] Move session from /tmp/ to session table
Diffstat (limited to 'modules-available/session')
-rw-r--r--modules-available/session/hooks/cron.inc.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules-available/session/hooks/cron.inc.php b/modules-available/session/hooks/cron.inc.php
new file mode 100644
index 00000000..e2cd46e6
--- /dev/null
+++ b/modules-available/session/hooks/cron.inc.php
@@ -0,0 +1,6 @@
+<?php
+
+// Clean up old sessions
+if (mt_rand(1, 10) === 4) {
+ Database::exec("DELETE FROM session WHERE dateline < UNIX_TIMESTAMP()");
+} \ No newline at end of file