This section provides result of the cookie test program. The result shows that persistent cookies are store in a file on the Web browser local system.
Request this ASP page, special_cookies.asp, with IE, you will get:
Cookies received at this time::
Cookies.Count = 0
Adding a persistent cookie:
Cookie_1 = Value_1
Adding a persistent cookie with domain:
Cookie_d_2 = Value_d_2
Adding a persistent cookie with keys:
Cookie_p_3.Item(Cookie_c_1_3) = Value_c_1_3
Cookie_p_3.Item(Cookie_c_2_4) = Value_c_2_4
Now click at your IE "Tools" menu and select "Internet Options...". Click the "Settings..."
button in the "Temporary Internet files" section of the "General" tab. You will see
where is your "Temporary Internet files folder". Go to that folder, you will see a cookie
file named something like "Cookie:user@localhost/". Double click on that file, you should
be able to open this file in notepad:
If you click the IE refresh button, you will get the following in the IE window:
Cookies received at this time::
Cookies.Count = 2
Cookie_p_3 = Cookie%5Fc%5F1%5F3=Value%5Fc%5F1%5F3&Cookie%5Fc%5F2%5...
Cookie_p_3.Item(Cookie_c_1_3) = Value_c_1_3
Cookie_p_3.Item(Cookie_c_2_4) = Value_c_2_4
Cookie_1 = Value_1
Adding a persistent cookie:
Cookie_3 = Value_3
Adding a persistent cookie with domain:
Cookie_d_4 = Value_d_4
Adding a persistent cookie with keys:
Cookie_p_5.Item(Cookie_c_1_5) = Value_c_1_5
Cookie_p_5.Item(Cookie_c_2_6) = Value_c_2_6
To prove that the cookies are really persisted, close your IE browser. And run it again
to request the same ASP page, special_cookies.asp, you will get:
Cookies received at this time::
Cookies.Count = 4
Cookie_p_3 = Cookie%5Fc%5F1%5F3=Value%5Fc%5F1%5F3&Cookie%5Fc%5F2%5...
Cookie_p_3.Item(Cookie_c_1_3) = Value_c_1_3
Cookie_p_3.Item(Cookie_c_2_4) = Value_c_2_4
Cookie_p_5 = Cookie%5Fc%5F1%5F5=Value%5Fc%5F1%5F5&Cookie%5Fc%5F2%5...
Cookie_p_5.Item(Cookie_c_1_5) = Value_c_1_5
Cookie_p_5.Item(Cookie_c_2_6) = Value_c_2_6
Cookie_1 = Value_1
Cookie_3 = Value_3
Adding a persistent cookie:
Cookie_5 = Value_5
Adding a persistent cookie with domain:
Cookie_d_6 = Value_d_6
Adding a persistent cookie with children:
Cookie_p_7.Item(Cookie_c_1_7) = Value_c_1_7
Cookie_p_7.Item(Cookie_c_2_8) = Value_c_2_8
From this tutorial, we have learned:
Cookies will be persisted into a file, if you set the expiration date.
Cookie expiration dates must be within Jan 1, 1980
and Jan 19, 2038. This is weird.
This cookie file is not so easy to read. But you can still figure out some
information. Of course, "%5F" represents "_".
Cookie names can not have space characters.
The default domain of a cookie is the domain from where it come from.
In our tutorial, all cookies are come from localhost/, so they all have this
domain name, when persisted into the cookie file.
My statement 'response.cookies(n).domain = "localhost/"' is not working.
Cookies defined with this statement were ignored by the IE browser.
IE browser only takes 20 cookies from one Web server.
IE browser can only support up to 300 cookies.
Each cookie is limited to 4 KB in size.
The cookie(n).Item(k) method is the default method, so it can be simplified as
cookie(n)(k).
Cookies with itemized values are just regular cookie with a special value format
of "key=value&key=value...".