Temporary Files and Tables for State Management
If you use temporary files or tables for state management, you need to consider the how to identify which records belong to which user and how to clean up orphan records if the user does not return to the site.
For simple state information, you can use the filedump and fileload ProcScript statement to store and retrieve state information.
For complex data, it is better to use temporary database tables. Uniface provides an automatic temporary-table mechanism for you to maintain state through its state management component USYSSTAT.
If you use temporary files or tables, you need to address the following issues:
- Session identification—you need to identify which records belongs to which user by combining with some other method. The method you choose must be foolproof. For example, if you use an IP address, be aware that users sharing a common proxy server to access the Internet appear to have the same IP address. Furthermore, some users can change an IP address between sessions if it is a leased address. For more information, see Session Management for Web Applications.
- Automatic cleanup—any orphan records created if the user does not return to the site to complete a transaction should contain a time stamp to allow periodic purging of unwanted data. Transactions have greater DBMS I/O overhead due to the need to read and write records for each request.