Cookies

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. A third-party cookie is one that allows information to be forwarded to a Web site other the one currently being accessed by the browser. In Internet Explorer 6.0, when a third-party cookie is sent to the browser can generate a dialog box that asks the user whether to accept or block the cookie. When third-party cookies are blocked the browser can only send cookie data back to the server that originally created them.

Cookies can be temporary or persistent. Persistent cookies, which have an expiration date, are stored in the location specified in the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders registry key. The default location is \Windows\Profiles\Guest\Cookies. Session cookies, which do not have an expiration date, are stored in memory and are available only to the process in which they were created.

The Windows Internet Services (WinInet) cookie functions are used to set cookies into and access cookies from the cookie database. Unlike most WinInet functions, the cookie functions do not require a call to InternetOpen. Use the WinInet functions InternetSetCookie, InternetSetCookieEx, and InternetGetCookie to retrieve and set cookies.

See Also

HTTP Sessions

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.