IXMLHTTPRequest2::SetCookie method
Sets a cookie associated with the specified URL in the HTTP cookie jar.
Syntax
HRESULT SetCookie(
const XHR_COOKIE *pCookie,
DWORD *pdwCookieState
);
Parameters
- pCookie
-
A pointer to an XHR_COOKIE structure that specifies the cookie and properties of the cookie to be associated with the specified URL.
- pdwCookieState
-
A pointer to a value that indicates the cookie state if the call completes successfully.
This parameter can be one of the values from the XHR_COOKIE_STATE enumeration type defined in the Msxml6.h header file.
Return value
Returns S_OK on success.
Remarks
The SetCookie method has different behavior for Windows Store apps and Classic Windows applications.
When used in a Windows Store app, the SetCookie method by default sets the cookie as a persistent cookie in the Windows Store app. When the dwFlags member of the XHR_COOKIE has the XHR_COOKIE_IS_SESSION flag set, then the cookie is set only for the current session of the app.
When used in a Classic Windows application, the SetCookie method by default sets a persistent cookie that is system wide and shared by all Classic Windows applications. When the dwFlags member of the XHR_COOKIE has the XHR_COOKIE_IS_SESSION flag set, then the cookie is set only for the current session of the Classic Windows application.
Requirements
|
Minimum supported client | Windows 8 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server | Windows Server 2012 [desktop apps | Windows Store apps] |
|
Minimum supported phone | Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps] |
|
Version | MSXML 6.0 and later |
|
Header |
|
|
IDL |
|
See also