1 |
Cookies were introduced by Netscape to preserve client state
|
2 |
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.
|
3 |
Traditionally, state variable were passed using "hidden" fields:
-
<INPUT type="hidden" name="user" value="">
-
formname.user.value = WHATHAVEYOU;
|
4 |
Such hidden fields are passed to CGI scripts in same fashion as other variables set in text fields, etc.
|
5 |
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
|
6 |
So hidden variables are nice but only preserved as long as you stick to page you started with or returned by CGI script
|