Systems-Level Functionality

Persistent Cookies

By default, cookies do not persist across sessions. Cookies that have a definite expiration date can be stored in a file determined by $CookieStore. Setting it to Automatic will let the system choose that file.

Initially, $CookieStore is set to None.

In[1]:=
Click for copyable input
$CookieStore
Out[1]=

Change it to Automatic.

In[2]:=
Click for copyable input
$CookieStore = Automatic
Out[2]=

This is the file that will contain persistent cookies.

In[3]:=
Click for copyable input
$CookieStore
Out[3]=

Cookies are stored in unprocessed form. Each line in the following list corresponds to a cookie. Each line will contain either TRUE or FALSE, or both.

In[4]:=
Click for copyable input
FindList[$CookieStore, {"TRUE", "FALSE"}]
Out[4]=

Visit a website.

In[5]:=
Click for copyable input
URLRead["amazon.com"]
Out[5]=

Now the cookie store file contains more cookies.

In[6]:=
Click for copyable input
FindList[$CookieStore, {"TRUE", "FALSE"}]
Out[6]=

Related Examples

de es fr ja ko pt-br ru zh