is a global variable that contains a list of cookies to be used by functions such as URLExecute.


  • $Cookies must be a list of associations, with each association representing a cookie.
  • The association for each cookie can contain the following elements:
  • "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)
  • "ExpirationDate" has value Automatic if the cookie is for the duration of the session only.
  • If not set, "Domain" is assumed to be Automatic, so that the domain is deduced from the specific URL from which the request was generated.
  • With the setting "AllSubdomains"->True, cookies are also sent to subdomains of the domain specified by "Domain".
  • If not set, "AllowSubdomains" is assumed to be Automatic, which corresponds to True if "Domain" is Automatic, and False otherwise.
  • If not set, "ConnectionType" is assumed to be All. "ConnectionType"->"HTTPS" specifies that the cookie should be sent only when an HTTPS connection is used.
  • If not set, "ScriptAccessible" is assumed to be True, indicating that web browsers should allow the cookie to be accessed using JavaScript, even if the JavaScript is on a page from another domain.
  • $Cookies can be modified using SetCookies and ClearCookies.
  • With the default setting CookieFunction->Automatic, functions like URLRead automatically append all newly received cookies to $Cookies.
  • Block[{$Cookies},] can be used to localize cookies. Block[{$Cookies,$CookieStore},] also blocks the saving of persistent cookies.


open allclose all

Basic Examples  (1)

View currently set cookies:

Cookies can be received and set when URL commands are executed:

Applications  (1)

URLRead and related functions process cookie requests from the server:

If there is a matching cookie in $Cookies, no request is made by the server:

Properties & Relations  (3)

Cookies can be added using SetCookies:

Cookies can be queried using FindCookies:

Cookies can be removed using ClearCookies:

Introduced in 2016