FindCookies

FindCookies[]

gives a list of all currently set cookies.

FindCookies[domain]

gives a list of cookies associated with the specified domain.

FindCookies[assoc]

gives a list of cookies whose attributes match the specification in the association assoc.

Details

  • FindCookies[] is equivalent to $Cookies.
  • FindCookies returns a list of associations representing the cookies it has found.
  • In FindCookies[domain], domain can be either a string or a string pattern of the type used in FileNames.
  • FindCookies[domain] is equivalent to FindCookies[<|"Domain"->domain|>].
  • In FindCookies[assoc], the association can contain entries with any of the following keys, with the same possible values as in $Cookies:
  • "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)

Examples

open allclose all

Basic Examples  (1)

Cookies are received and set when URL commands are executed:

Find all cookies:

Find cookies by domain:

Find cookies with a specified name:

Find cookies with an expiration date of Automatic:

Find cookies with explicit expiration dates:

Properties & Relations  (1)

FindCookies[] returns all cookies present in $Cookies:

Introduced in 2016
 (11.0)