Cookies are used for tracking data settings, or data for a particular Web site. The cookies are saved on the client device, and when the browser requests a page, it sends the data settings for that page along with the request. The browser can only send the data back to the server that originally created them; therefore, cookies are a secure way of maintaining user-specific data. Cookies can be temporary or persistent.
The Windows CE Internet functions have a persistent cookie database for this purpose. The Windows CE Internet cookie functions are used to set cookies into and access cookies from the cookie database. For more information, see HTTP Cookies.
The Windows CE Internet functions InternetSetCookie and InternetGetCookie can be used to manage cookies.
Unlike most Windows CE Internet functions, the cookie functions do not require a call to InternetOpen. Cookies that have an expiration date, persistent cookies, are stored in the Windows\Cookies directory. Cookies that do not have an expiration date, session cookies, are stored in memory and are available only to the process in which they were created.
InternetGetCookie returns the cookies for the specified URL, and all its parent URLs. InternetGetCookie checks persistent storage for cookies, and searches memory for any cookies that do not have an expiration date, since these cookies are not written to any files.
InternetSetCookie is used to set a cookie on the specified URL. InternetSetCookie can create both persistent and session cookies.