Cookies, by default, when created using the following code sample, expire when the browser closes:
If, however, the Expires property is set to a date and time in the future of the current date and time, a persistent cookie file will be written to the local client hard drive. For Internet Explorer, cookies are placed in the c:\Documents and Settings\[user_name]\Cookies directory.
Therefore, the code sample below will write a permanent cookie to the clients hard drive because the Expire property was set to a time in the future.
Now, looking into my local cookies directory I see my new cookie file:
If I open the cookie, I can now see the name of the cookie “TestCookie” and the name-value pair that I stored in the cookie: setting1-test.



