21. mt::ListSessions

[<<<] [>>>]

This subroutine collects the session ids.

  call mt::ListSessions Array,Sm,SM,Pm,PM,Tm,TM

The first argument to the subroutine should be a variable. This variable will loose its previous value and gets a new array value containing the session strings.

If there is no more arguments to the subroutine call this array will contain all the existing sessions in the MT module. However the programmer may define six optional parameters that select only certain sessions that have time value parameters that are between the specified values. These are

These time values have to be expressed as GTM time stamps. If a value is zero or undef the value in the constraint is ignored. Unspecified arguments are undef by ScriptBasic behaviour.

For example to get the list of all sessions that are older than an hour

call mt::ListSession Array,undef,GmTime()-60*60

To get all session IDs that timed out:

call mt::ListSession Array,undef,undef,undef,undef,undef,GmTime()

To get all sessions that are idle for more than ten minutes

call mt::ListSession Array,undef,undef,undef,GmTime()-600

Note that this subroutine is rarely used in "cgi" scripts. This subroutine has to be used in scripts that are run by the Eszter SB Engine asynchronously started using the configuration key httpd.run.[re]start. Those scripts start before the engine starts to listen on a port and run so long as long the engine runs and are able to scan the sessions from time to time and delete the old sessions freeing the memoryof the module MT.


[<<<] [>>>]