SG57 keep in mind that file might get reverted anytime you update Flarum or an extension.
The original "trick" from 2019 is still valid, the only thing that changed is that it must be called through a service provider rather than a callback. I tested this code is valid but I haven't tested if it actually achieves what is intended in practice:
<?php
// File <flarum>/extend.php
use Flarum\Extend;
use Flarum\Foundation\AbstractServiceProvider;
use Illuminate\Contracts\Config\Repository as ConfigRepository;
class MyServiceProvider extends AbstractServiceProvider {
public function register () {
$this->container->make(ConfigRepository::class)->set('session.lifetime', 240); // In minutes. Default is 120
}
}
return [
// Register extenders here to customize your forum!
(new Extend\ServiceProvider)
->register(MyServiceProvider::class),
];
Just like in 2019, this doesn't change anything to the session access tokens though. Those still have their own logic to manage expiration.