Cookies were introduced by Netscape to preserve client state
|
For a CGI script servicing several clients (ordering T-shirts perhaps), it is useful for the client (not server) to store information such as name of user, passwords, etc.
|
Traditionally, state variable were passed using "hidden" fields:
-
<INPUT type="hidden" name="user" value="">
-
formname.user.value = WHATHAVEYOU;
|
Such hidden fields are passed to CGI scripts in same fashion as other variables set in text fields, etc.
|
Hidden values can either by set by JavaScript on the client or embedded into a page constructed by a CGI script, which might read N values and return a new form with M new fields and N old entries preserved in hidden fields
|
So hidden variables are nice but only preserved as long as you stick to page you started with or returned by CGI script
|