static BOOL GetCookie( LPCSTR pstrUrl, LPCTSTR pstrCookieName, LPTSTR pstrCookieData, DWORD dwBufLen );
static BOOL GetCookie( LPCSTR pstrUrl, LPCTSTR pstrCookieName, CString& strCookieData );
Return Value
Returns TRUE if successful, or FALSE otherwise. If the call fails, call the Win32 function GetLastError to determine the cause of the error. The following error values apply:
Parameters
pstrUrl
A pointer to a string containing the URL.
pstrCookieName
A pointer to a string containing the name of the cookie to get for the specified URL.
pstrCookieData
In the first overload, a pointer to a string containing the address of the buffer that receives the cookie data. This value can be NULL. In the second overload, a reference to a CString object to receive the cookie data.
dwBufLen
The variable specifying the size of the pstrCookieData buffer. If the function succeeds, the buffer receives the amount of data copied to the pstrCookieData buffer. If pstrCookieData is NULL, this parameter receives a value that specifies the size of the buffer necessary to copy all the cookie data.
Remarks
This member function implements the behavior of the Win32 function InternetGetCookie , as described in the Platform SDK.
In the second overload, MFC retrieves the cookie data into the supplied CString object.
See Also CInternetSession::GetCookieLength, CInternetSession::SetCookie