Topic Path: Symbol Reference > Classes > TIdHTTPDefaultSessionList Class > TIdHTTPDefaultSessionList Methods > PurgeStaleSessions Method
TIdHTTPDefaultSessionList.PurgeStaleSessions Method

Removes one or more expired sessions from the session list.

procedure PurgeStaleSessions(
    PurgeAll: Boolean = false
); override;
Clear one or all stale sessions. Default value is False. 

PurgeStaleSessions is an overridden procedure used to remove persistent HTTP sessions where the last access timestamp in TIdHTTPSession and the session timeout in TIdCustomHTTPServer indicate that the session has expired. 

PurgeStaleSessions can be used to remove one or more session that have expired, as indicated in the PurgeAll argument. 

PurgeStaleSessions will iteratively call the internal RemoveSessionFromLockedList method to remove the expired session(s). When Purge all contains True, all sessions will be purged regardless of the settings in the persistent TIdHTTPSession item. 

PurgeStaleSessions ensures that the session list is locked prior to removing stale sessions, and is unlocked prior to exiting from the method.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.