API15

JSessionStorageDatabase/gc: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Garbage collect stale sessions from the SessionHandler backend. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JSessionStorageData...
 
m removing red link to edit, no existant pages
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JSessionStorageDatabase/gc|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JSessionStorageDatabase/gc}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 46: Line 46:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JSessionStorageDatabase/gc|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JSessionStorageDatabase/gc}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
Line 61: Line 61:
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Revision as of 18:48, 12 May 2013

Description

Garbage collect stale sessions from the SessionHandler backend.

[<! removed edit link to red link >]

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

Syntax

gc($maxlifetime)
Parameter Name Default Value Description
$maxlifetime $maxlifetime The maximum age of a session.

Returns

boolean True on success, false otherwise.

Defined in

libraries/joomla/session/storage/database.php

Importing

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

Source Body

function gc($maxlifetime)
{
        $db =& JFactory::getDBO();
        if(!$db->connected()) {
                return false;
        }

        $session = & JTable::getInstance('session');
        $session->purge($maxlifetime);
        return true;
}

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

Examples

<CodeExamplesForm />