Contents Index Topic Contents | ||
Previous Topic: Cookie Functions Next Topic: InternetSetCookie |
InternetGetCookie
BOOL InternetGetCookie( IN LPCSTR lpszUrlName, IN LPCSTR lpszCookieName, OUT LPSTR lpszCookieData, IN OUT LPDWORD lpdwSize );Returns the cookie for the specified URL.
- Returns TRUE if successful, or FALSE otherwise. To get the specific error value, call GetLastError. The following error values apply to InternetGetCookie:
ERROR_NO_MORE_ITEMS There is no cookie for the specified URL and all its parents. ERROR_INSUFFICIENT_BUFFER The value passed in lpdwSize is insufficient to copy all the cookie data. The value returned in lpdwSize is the size of the buffer necessary to get all the data.
- lpszUrlName
- Address of a string that contains the URL to get cookies for.
- lpszCookieName
- Address of the name of the cookie to get for the specified URL. This has not been implemented in this release.
- lpszCookieData
- Address of the buffer that receives the cookie data. This value can be NULL.
- lpdwSize
- Address of a 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.
InternetGetCookie does not require a call to InternetOpen. InternetGetCookie checks in the windows\cookies directory for cookies and searches memory for any cookies that do not have an expiration date, since these cookies are not written to any files. Rules for creating cookie files are internal to Win32 Internet functions and may change in the future.
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.