ContentsIndexPreviousNext

8.3.3 CGI Guidelines

When writing a CGI program, keep the following guidelines or conditions in mind:

For example, if a client invokes a CGI program to "log in" to your application or to add an item to his/her "shopping cart", the CGI program must record that fact along with any user identification information in a file or database. When the CGI program generates the HTML output, it should encode a user ID or key in a CGI variable that will get passed to the next CGI program that the client invokes. The next CGI program can then look up the user state information (for example, shopping cart contents) from the database. The user state information should also include a date/time "stamp" so that a maintenance program can delete records for users who haven't logged in a specified amount of time or who left the application without logging out.