InternetGetCookie

This function retrieves the cookie for the specified URL.

At a Glance

Header file: Wininet.h
Windows CE versions: 2.12 and later

Syntax

BOOL InternetGetCookie (LPCTSTR lpszUrl,
LPCTSTR
lpszCookieName, LPSTR lpCookieData, LPDWORD lpdwSize);

Parameters

lpszUrl

[in] Address of a string that contains the URL to get cookies for.

lpszCookieName

[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.

lpCookieData

[out] Address of the buffer that receives the cookie data. This value can be NULL.

lpdwSize

[in] [out] Address of an unsigned long integer variable that specifies the size of the lpszCookieData buffer. 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.

Return Values

Returns TRUE if successful, or FALSE otherwise.

Remarks

This function does not require a call to InternetOpen. This function checks in the windows\cookies directory for persistent cookies that have an expiration date set sometime in the future. This function also searches memory for any session cookies (cookies that do not have an expiration date) that were created in the same process by InternetSetCookie, since these cookies are not written to any files. Rules for creating cookie files are internal to Win32® Internet functions and might change in the future.

See Also

InternetSetCookie