Actions

API15

JTableSession/purge

From Joomla! Documentation

< API15:JTableSession
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Purge old sessions

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

purge($maxLifetime=1440)
Parameter Name Default Value Description
$maxLifetime 1440 Session age in seconds

Returns

mixed Resource on success, null on fail

Defined in

libraries/joomla/database/table/session.php

Importing

jimport( 'joomla.database.table.session' );

Source Body

function purge( $maxLifetime = 1440 )
{
        $past = time() - $maxLifetime;
        $query = 'DELETE FROM '. $this->_tbl .' WHERE ( time < \''. (int) $past .'\' )'; // Index on 'VARCHAR'
        $this->_db->setQuery($query);
 
        return $this->_db->query();
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />