A well-known problem with the Web is that the HTTP protocol gives no way of knowing when the user has finished with a session. A connection is not kept open from the start to end of a session: instead, a new connection is made on each transaction, and closed as soon as this finishes. We provide a ``Delete session'' button with Tow, but there is no guarantee that people will use it.
To avoid old instances accumulating, the server interface timestamps each root instance whenever it or one of its sub-instances is accessed. By using the Cron program, we arrange for an ``instance vulture'' demon to run at regular intervals and to check the timestamps on all root instances, deleting those that are too old. There is a default ``expiry grace'' which is currently 20 minutes: any instance timestamped longer ago than that will be deleted. This can be overridden by particular sessions.
We also need to worry about temporary files. In Tow, these include
HTML output files from programs, and GIF files plotted by calling
Gnuplot dynamically. We insist that all such files
be placed in a certain directory. Cron periodically runs a ``file
vulture'' which checks these files' creation dates, again deleting any that
are too old. As with instance expiry, some sessions may need to override
the default file expiry grace. They can do this by creating an auxiliary
file, whose name is the same but with
_details
appended. The file
vulture will look for this file --- if it finds it, it reads one line from
it, and assumes this to be an expiry time which it will use in place of
the default.