ASP  «Prev  

CGI Solution for maintaining Session

If you have done any CGI programming, then you have probably used the "hidden field" trick to get around the state problem. If you want to store a value between page accesses, you store the value in a form element with the hidden input type:

<INPUT TYPE="Hidden" NAME="PreferredSize" VALUE="XXL"> 

With each new page, you set the value of the hidden field to the value you have just received, and then pass the value on to the next page. There are two problems with the hidden field trick though:
  1. You have to write extra HTML both for the hidden fields themselves and to create the HTML forms surrounding those values.
  2. You can only pass strings (as in the size example above). Hidden fields are less useful if you want to store more complex objects, such as a database connection.