REDROOM
PHP 8.1.33
Path:
Logout
Edit File
Size: 1.75 KB
Close
/home/jambtst2015/public_html/ida.com.ng/plugins/system/sessiongc/sessiongc.php
Text
Base64
<?php /** * @package Joomla.Plugin * @subpackage System.sessiongc * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Factory; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\CMS\Session\MetadataManager; /** * Garbage collection handler for session related data * * @since 3.8.6 */ class PlgSystemSessionGc extends CMSPlugin { /** * Application object * * @var CMSApplication * @since 3.8.6 */ protected $app; /** * Database driver * * @var JDatabaseDriver * @since 3.8.6 */ protected $db; /** * Runs after the HTTP response has been sent to the client and performs garbage collection tasks * * @return void * * @since 3.8.6 */ public function onAfterRespond() { if ($this->params->get('enable_session_gc', 1)) { $probability = $this->params->get('gc_probability', 1); $divisor = $this->params->get('gc_divisor', 100); $random = $divisor * lcg_value(); if ($probability > 0 && $random < $probability) { $this->app->getSession()->gc(); } } if ($this->app->get('session_handler', 'none') !== 'database' && $this->params->get('enable_session_metadata_gc', 1)) { $probability = $this->params->get('gc_probability', 1); $divisor = $this->params->get('gc_divisor', 100); $random = $divisor * lcg_value(); if ($probability > 0 && $random < $probability) { /** @var MetadataManager $metadataManager */ $metadataManager = Factory::getContainer()->get(MetadataManager::class); $metadataManager->deletePriorTo(time() - $this->app->getSession()->getExpire()); } } } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 2
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
sessiongc.php
1.75 KB
lrw-r--r--
2024-11-22 17:53:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
sessiongc.xml
2.22 KB
lrw-r--r--
2024-11-22 17:53:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).