Maintaining State Cookies

Some web services and many form-based web sites rely on a web client mechanism to maintain information that allows the server to reestablish a request context or reconnect with a process awaiting the request. The mechanism most often used for this purpose is cookies.

Cookies come in two forms:
  • Persistent cookies - Maintained between sessions in a disk file on the client machine
  • Session cookies - Exist only during the lifetime of a web client instance.

Cookies work behind the scenes in browsers. You must enable cookies in your web client to inform RMNet about the files that maintain persistent cookies. You do this by calling HttpSetCookieFile at the beginning of your client session. HttpSetCookieFile may be called multiple times to inform RMNet about several files that maintain persistent cookies. To use only session cookies, call HttpSetCookieFile without using the cookie file parameter or set the file name parameter to spaces. In RMNet terms, a session exists between the call to NetInit and the call to NetCleanup.