A version of this page is also available for
This function retrieves the cookie for the specified URL.
BOOL InternetGetCookie( LPCTSTR lpszUrl, LPCTSTR lpszCookieName, LPSTR lpCookieData, LPDWORD lpdwSize );
[in] Address of a string that contains the URL to get cookies for.
[in] Address of a string that contains the name of the cookie to get for the specified URL. This has not been implemented in this release.
[out] Address of the buffer that receives the cookie data. This value can be NULL.
[in, out] When the function is called, the address of an unsigned long integer variable that specifies the size of the lpszCookieData buffer. On return, if the function succeeds, the buffer receives the amount of data copied to the lpszCookieData buffer. If lpszCookieData is NULL, this parameter receives a value that specifies the size of the buffer necessary to copy all the cookie data.
Returns TRUE if successful, or FALSE otherwise.
This function does not require a call to InternetOpen. To retrieve cookies, it checks for both session cookies and persistent 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. 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. Because the rules for creating cookie files are internal to WinInet functions and are subject to change, your application should always call InternetGetCookie, rather than attempt to access cookie files directly.
|Windows Embedded CE||Windows CE 2.12 and later|
|Windows Mobile||Windows Mobile Version 5.0 and later|