Wolfram Language

Systems-Level Functionality

Explore Cookies

When you visit some sites, the server may send information to your computer in the form of "cookies", pieces of text with different purposes.

Visiting some sites sets cookies to the variable $Cookies.

Use URLRead to visit the Wolfram and Wolfram|Alpha sites.

In[1]:=
Click for copyable input
response1 = URLRead["wolfram.com"]
Out[1]=
In[2]:=
Click for copyable input
response2 = URLRead["wolframalpha.com"]
Out[2]=

Each response contains a list of cookies, each one given as an association of several fields.

In[3]:=
Click for copyable input
response1["Cookies"]
Out[3]=
In[4]:=
Click for copyable input
response2["Cookies"]
Out[4]=

All cookies are stored in $Cookies.

In[5]:=
Click for copyable input
$Cookies
Out[5]=

Find the cookies associated to a given domain.

In[6]:=
Click for copyable input
FindCookies["wolfram.com"]
Out[6]=

In a given session, subsequent requests to the server do not include any cookies in the responses.

In[7]:=
Click for copyable input
response3 = URLRead["wolframalpha.com"]
Out[7]=
In[8]:=
Click for copyable input
response3["Cookies"]
Out[8]=

Related Examples

de es fr ja ko pt-br ru zh