XHR_COOKIE structure (msxml6.h)

Defines a cookie that you can add to the HTTP cookie jar by calling the SetCookie method or retrieve from the HTTP cookie jar by calling the GetCookie method.

Syntax

typedef struct tagXHR_COOKIE {
  WCHAR    *pwszUrl;
  WCHAR    *pwszName;
  WCHAR    *pwszValue;
  WCHAR    *pwszP3PPolicy;
  FILETIME ftExpires;
  DWORD    dwFlags;
} XHR_COOKIE;

Members

pwszUrl

A null-terminated string that specifies the URL in the cookie.

pwszName

A null-terminated string that specifies the name in the cookie.

pwszValue

A null-terminated string that specifies the value in the cookie.

pwszP3PPolicy

A null-terminated string that specifies the user policy in the cookie.

ftExpires

A null-terminated string that specifies the date and time at which the cookie expires.

dwFlags

A set of bit flags that specifies properties of the cookie.

This member can be one of the values from the XHR_COOKIE_FLAG enumeration type defined in the Msxml6.h header file.

Value Meaning
XHR_COOKIE_IS_SECURE
0x1
XHR_COOKIE_IS_SESSION
0x2
The cookie is a session cookie and not a persistent cookie.
XHR_COOKIE_THIRD_PARTY
0x10
Indicates that the cookie being set is a third-party cookie.
XHR_COOKIE_PROMPT_REQUIRED
0x20
XHR_COOKIE_EVALUATE_P3P
0x40
If this flag is set, the pwszP3PPolicy member points to a Platform-for-Privacy-Protection (P3P) header for the cookie in question.
XHR_COOKIE_APPLY_P3P
0x80
XHR_COOKIE_APPLY_P3P
0x100
XHR_COOKIE_IS_RESTRICTED
0x200
Indicates that the cookie being set is associated with an untrusted site.
XHR_COOKIE_IE6
0x400
XHR_COOKIE_IS_LEGACY
0x800
XHR_COOKIE_NON_SCRIPT
0x1000
XHR_COOKIE_HTTPONLY
0x2000
Enables the retrieval of cookies that are marked as "HTTPOnly".

Do not use this flag if you expose a scriptable interface, because this has security implications. If you expose a scriptable interface, you can become an attack vector for cross-site scripting attacks. It is imperative that you use this flag only if they can guarantee that you will never permit third-party code to set a cookie using this flag by way of an extensibility mechanism you provide.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps],MSXML 6.0 and later
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Header msxml6.h

See also

IXMLHTTPRequest2 Interface

SetCookie Method

SetProperty Method