SetCookies
✖
SetCookies
sets cookies with attributes specified by the association assoc, to be used by functions such as URLExecute.
Details

- In SetCookies[assoc], the following entries can appear in the association, 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) - "ExpirationDate"->Automatic indicates that a cookie is for this session only, and is not persistent.
- SetCookies can set both session cookies and persistent cookies.
- All cookies that have been set are reflected in the list $Cookies. Information on persistent cookies is stored in the location specified by $CookieStore.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases

https://wolfram.com/xid/0dqtmecgclw-tjw9ra


https://wolfram.com/xid/0dqtmecgclw-w923j8

The cookies are stored in $Cookies for later use:

https://wolfram.com/xid/0dqtmecgclw-8qgota

Applications (2)Sample problems that can be solved with this function
URLRead and related functions process cookie requests from the server:

https://wolfram.com/xid/0dqtmecgclw-vkd0ms


https://wolfram.com/xid/0dqtmecgclw-dykwsd

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

https://wolfram.com/xid/0dqtmecgclw-lartqe


https://wolfram.com/xid/0dqtmecgclw-3xcok5

ClearCookies removes cookies:

https://wolfram.com/xid/0dqtmecgclw-210em5


https://wolfram.com/xid/0dqtmecgclw-oefryz

Those cookies can be later restored using SetCookies:

https://wolfram.com/xid/0dqtmecgclw-dtrlnn


https://wolfram.com/xid/0dqtmecgclw-wd46y9

Wolfram Research (2016), SetCookies, Wolfram Language function, https://reference.wolfram.com/language/ref/SetCookies.html.
Text
Wolfram Research (2016), SetCookies, Wolfram Language function, https://reference.wolfram.com/language/ref/SetCookies.html.
Wolfram Research (2016), SetCookies, Wolfram Language function, https://reference.wolfram.com/language/ref/SetCookies.html.
CMS
Wolfram Language. 2016. "SetCookies." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SetCookies.html.
Wolfram Language. 2016. "SetCookies." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SetCookies.html.
APA
Wolfram Language. (2016). SetCookies. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SetCookies.html
Wolfram Language. (2016). SetCookies. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SetCookies.html
BibTeX
@misc{reference.wolfram_2025_setcookies, author="Wolfram Research", title="{SetCookies}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/SetCookies.html}", note=[Accessed: 08-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_setcookies, organization={Wolfram Research}, title={SetCookies}, year={2016}, url={https://reference.wolfram.com/language/ref/SetCookies.html}, note=[Accessed: 08-July-2025
]}