diff --git a/cli/sessionGc.php b/cli/sessionGc.php new file mode 100644 index 0000000000000..4fe6e8a4fc7ee --- /dev/null +++ b/cli/sessionGc.php @@ -0,0 +1,56 @@ +gc(); + } +} + +JApplicationCli::getInstance('SessionGc')->execute(); diff --git a/libraries/src/Session/Session.php b/libraries/src/Session/Session.php index a2b3a6da83cb1..fbcb3059067be 100644 --- a/libraries/src/Session/Session.php +++ b/libraries/src/Session/Session.php @@ -834,6 +834,18 @@ public function close() $this->_state = 'inactive'; } + /** + * Delete expired session data + * + * @return boolean True on success, false otherwise. + * + * @since __DEPLOY_VERSION__ + */ + public function gc() + { + return $this->_store->gc($this->getExpire()); + } + /** * Set the session handler *