|
|
| htmlCookie provides automated access for sending and receiving persistent HTTP cookies to and from web browsers. Cookies are a general mechanism which server applications can use to store and retrieve information from web browsers. Cookies greatly extend the capabilities of html++ applications.
|
|
|
| A server, when transmitting a page to a browser, may optionally send a user-defined value, called a cookie, that represents state information which the browser will store. Included in the cookie is a description of the range of URL's for which that state is valid, and a date after which the browser may delete the cookie. The browser will send the cookie back to the server for any future page requests within the range of specified URL's. The htmlCookie class encapsulates all aspects of cookie manipulation, making their use both easy and convenient.
|
|
|
| By using the htmlCookie class with the appropriate htmlServer dervied class (htmlCgi or htmlISAPI), your applications will be able to recognize individual browsers and store information about selections, user id's, passwords, and more.
|
|
|
| Only one cookie object is allowed per page. Multiple name/value pairs (NetScape has a limit of 20 per domain, not to exceed 4K total) can be specified, though typically only one is all that's needed for storing a database record number or some other unique identifier.
|
|
|
| The htmlServer::Cookie() method provides access to the cookie object for a session, which is created automatically during htmlServer construction. To see if a cookie was sent with a page request by the browser, use the inherited CNVList::Exists() method to check for a cookie value by name. The following is an example:
|
|
|
| |