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.
Details
- 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.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Echo received cookies:
https://wolfram.com/xid/05fb70un32-sxrk39
https://wolfram.com/xid/05fb70un32-cp4hip
The default value of Automatic holds received cookies:
https://wolfram.com/xid/05fb70un32-yynosa
https://wolfram.com/xid/05fb70un32-diit2k
Applications (1)Sample problems that can be solved with this function
https://wolfram.com/xid/05fb70un32-vo5a4a
Create a function that echoes received cookies and stores them for later use:
https://wolfram.com/xid/05fb70un32-f5cnhb
https://wolfram.com/xid/05fb70un32-fk74cw
The cookie is now stored in $Cookies:
https://wolfram.com/xid/05fb70un32-y8qzvo
On subsequent calls to the domain, the cookie will not be reset:
https://wolfram.com/xid/05fb70un32-8h1d7v
Wolfram Research (2016), CookieFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/CookieFunction.html.
Text
Wolfram Research (2016), CookieFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/CookieFunction.html.
Wolfram Research (2016), CookieFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/CookieFunction.html.
CMS
Wolfram Language. 2016. "CookieFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CookieFunction.html.
Wolfram Language. 2016. "CookieFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CookieFunction.html.
APA
Wolfram Language. (2016). CookieFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CookieFunction.html
Wolfram Language. (2016). CookieFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CookieFunction.html
BibTeX
@misc{reference.wolfram_2024_cookiefunction, author="Wolfram Research", title="{CookieFunction}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/CookieFunction.html}", note=[Accessed: 09-January-2025
]}
BibLaTeX
@online{reference.wolfram_2024_cookiefunction, organization={Wolfram Research}, title={CookieFunction}, year={2016}, url={https://reference.wolfram.com/language/ref/CookieFunction.html}, note=[Accessed: 09-January-2025
]}