CHttpClient::SetCookie Method  
 
BOOL SetCookie(
  LPCTSTR lpszCookieName,  
  LPCTSTR lpszCookieValue  
);

The SetCookie method sends the specified cookie to the server when a resource is requested.

Parameters

lpszCookieName
Pointer to a string which specifies the name of the cookie that will be sent to the server when the next resource is requested.
lpszCookieValue
Pointer to a string which specifies the value of the cookie. To delete a cookie that has been previously set, this parameter should be NULL or point to an empty string.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The SetCookie method submits the cookie name and value to the server when a resource is requested or data is posted to a script. For more information about cookies and how they are used, refer to the GetCookie method.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: cshtpv10.lib

See Also

GetCookie, GetFirstCookie, GetNextCookie, SetHeader