Partilhar via


CInternetSession::SetCookie

Sets a cookie for the specified URL.

static BOOL SetCookie(
   LPCTSTR pstrUrl,
   LPCTSTR pstrCookieName,
   LPCTSTR pstrCookieData 
);

Parameters

  • pstrUrl
    A pointer to a null-terminated string that specifies the URL for which the cookie should be set.

  • pstrCookieName
    A pointer to a string containing the name of the cookie.

  • pstrCookieData
    A pointer to a string containing the actual string data to associate with the URL.

Return Value

Returns TRUE if successful, or FALSE otherwise. To get the specific error code, call GetLastError.

Remarks

This member function implements the behavior of the Win32 message InternetSetCookie, as described in the Windows SDK.

Requirements

Header: afxinet.h

See Also

Reference

CInternetSession::GetCookieLength

CInternetSession::GetCookie