$config['debug'] = 1;
<?php
class OverrideSessionTimeout_Listener
{
public static function override(XenForo_Dependencies_Abstract $dependencies, array $data)
{
$options = new XenForo_Options($data['options']);
$options->__set('onlineStatusTimeout', 1440);
XenForo_Application::setDefaultsFromOptions($options);
XenForo_Application::set('options', $options);
}
}
public function __construct(array $config = array(), Zend_Cache_Core $cache = null, Zend_Db_Adapter_Abstract $db = null)
{
if (empty($config['admin']))
{
$defaultConfig = array(
'table' => 'xf_session',
'cacheName' => 'session',
'cookie' => 'session',
'lifetime' => 3600
);
}
I found that session timeout be cleared by Hourly Cron job -> This is the reason for maximum time = 60 minutes.
Delete/disable the cron job.Is there any way to prevent this?
Delete/disable the cron job.
Ok this appears to work...
Download the attached zip file, unzip, and upload the contents to the library directory on your server. You will have this file structure:
library
> OverrideSessionTimeout
> > Listener.php
Then enable debug mode as before. Create a new listener:
Admin CP -> Development -> Code Event Listeners -> Create New Code Event Listener
> Listen to Event: init_dependencies
> Execute Callback: OverrideSessionTimeout_Listener :: override
View attachment 18894
Save that and you should be good to go. You can edit Listener.php to set the timeout. I have it set to 1440 minutes (1 day):
Rich (BB code):<?php class OverrideSessionTimeout_Listener { public static function override(XenForo_Dependencies_Abstract $dependencies, array $data) { $options = new XenForo_Options($data['options']); $options->__set('onlineStatusTimeout', 1440); XenForo_Application::setDefaultsFromOptions($options); XenForo_Application::set('options', $options); } }
Does this work at 1.2 as well?
What is the name of the cron job that we need to disable?
I've had it disabled for a long time and it hasn't resulted in any "mess," but it does also affect Last Activity/last seen, see here.Can anyone tell me what mess might be left if this job is disabled?
Thanks
We use essential cookies to make this site work, and optional cookies to enhance your experience.