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:
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:
- You have to write extra HTML both for the hidden fields themselves and to create the HTML forms surrounding those values.
- 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.