Clean up a session

When a script is running within a session, it can clean up that session by calling the CleanupSession command.

CleanupSession;

When this command completes, the data for the session is removed from the disk and the constant _sessiondir becomes empty. Also, the value of _session_active is set to False, and _sessionid is empty.

In addition to this command, you can use the command ExpireSessions to clean up old sessions in bulk, based on age (time since session creation) or the elapsed time since the last time the session was accessed.