Cookies - "hidden" alternative
Cookies were introduced by Netscape to preserve client side state
If you have a CGI script that services several clients (ordering T Shirts perhaps), it is neatest to use client and not server to store information such as name of user, passwords etc.
Traditionally saved state in forms for a session preserved using "hidden" fields
- <INPUT type=hidden" name="username" value="" >
- set by formname.username.value = WHATHAVEYOU;
Such hidden fields are passed to CGI scripts in same fashion as other variables set in form text fields
hidden values can either by set by JavaScript on client side or returned built into a page constructed by CGI script which might read N values and return a new form with M new fields for client to fill in and N old entries preserved in hidden fields
So hidden variables are nice but only preserved as long as you keep to page you started with or that returned by CGI script.