Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

CookieFunction

CookieFunction
is an option for URLRead, HTTPRequest, and related functions that gives a function to apply to each cookie received when an HTTP response is received.

DetailsDetails

  • CookieFunction->f applies f to the association that represents each received cookie.
  • CookieFunction->Automatic is equivalent to CookieFunction->SetCookies.
  • CookieFunction->None effectively blocks all cookies.
  • The entries in the association for a given cookie are:
  • "Domain"domain for the cookie
    "Path"path restriction within the domain
    "Name"name of the cookie
    "Content"content of the cookie
    "ExpirationDate"when the cookie is set to expire
    "CreationDate"when the cookie was created
    "AllowSubdomains"whether to send cookies to subdomains (HostOnly)
    "ConnectionType"for what connection type the cookie should be sent (Secure)
    "ScriptAccessible"whether cookie is accessible from JavaScript etc. (HttpOnly)
  • CookieFunction is effectively applied to the "Cookies" entry in an HTTPResponse object.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Echo received cookies:

In[3]:=
Click for copyable input

No cookies are set:

In[4]:=
Click for copyable input
Out[4]=

The default value of Automatic holds received cookies:

In[5]:=
Click for copyable input

Cookies are now set:

In[6]:=
Click for copyable input
Out[6]=
Introduced in 2016
(11.0)