1
0
Fork 0

Add internal cronjob for PHP session cleanup

master
Anonymous Contributor 2023-09-10 04:53:40 +02:00
parent bb40c8c9a4
commit 80db5f35d1
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Mcp\Cron;
class SessionCleanup extends CronJob
{
public function __construct(\Mcp\Mcp $app)
{
parent::__construct($app, Frequency::HOURLY);
}
public function run(): bool
{
error_log("Session GC");
session_start();
session_gc();
return true;
}
}