View Full Version : about cookies

01-16-2004, 11:31 AM
I am wondering about how the cookies are saved by system: How to name the cookies file and where to save it?
It should be saved on the client side, right? And the fold to save seems to be"C:\Documents and Settings\username\Cookies". I don't know if the information of the cookies will also be saved somewhere else.

How different *.html files to share the same cookie?

Thank you in advance!

01-16-2004, 12:10 PM
How they are named and how they are stored on your harddrive is up to the browser. The functionality is as follows:

- Cookies are limited to one domain. There is a limit of 20 cookies per domain. Cookies can be read only from pages from that domain.
- Cookies can further be limited by paths, so that only pages with a specific path on that domain may read the cookie.
- Cookies have an expiry date. If no such date is set, they will only survive as long as the browser session is still running.
- Cookies that pass the expiry date are removed, but not necessarily from your harddrive. It depends on how yourbrowse rstores them.
- Cookies may be 4kb long each, name of the cookie included.
- Your max limit is no smaller than 300 cookies in total.
- Most browsers allow no longer expiry time than three years. Some have a 90 day limit even.

Netscape store all it's cookies in one file. Microsoft stores one file per cookie, in the Temporary Internet Files directory or in a specific subdirectory to the user directory under Documents and Settings. This is OS and browser version dependent, and pretty uninteresting except for the cases where you want to remove a specific cookie from your system. The important data is all within the cookie itself.

01-27-2004, 04:19 PM
- Cookies may be 4kb long each, name of the cookie included.

Hmm, I used the search engine @ these boards and it is a bit unclear to me if the statement above is true or not; some older posts were saying that the total size for a domains cookies can be max 4 kb and not 4 kb each.

Which is true ?

Is there some kind of general cookie-specification out there, I searched the w3c.org through google but I could not find anything.

01-27-2004, 04:42 PM
But you didn't search these forums good enough, it seems. :) This is a match on the words 'cookie' and 'spec':

<http://codingforums.com/showthread.php?s=&threadid=31146> addresses just what you are asking about, and <http://codingforums.com/showthread.php?s=&threadid=17304> also mentions it.

01-27-2004, 08:02 PM
Oh, the first link I had only been to, but I thought it concerned NS only, the second thread seems to be much better [to me], thanks

01-27-2004, 08:14 PM
The first thread to be picky concerns NN only, yes. However, that is the spec that everyone goes after, because Netscape were the ones that brought this technology together. While Netscape were the de facto standard, they were also the ultimate source for information and specifications. Ie5 was the browser that changed things from that state, but how cookies work were already set in stone by then. Note that cookie part of the RFC is built based on the Netscape cookie spec, and that Netscape were one of the two companies writing the RFC.
Network Working Group D. Kristol
Request for Comments: 2109 Bell Laboratories, Lucent Technologies
Category: Standards Track L. Montulli
Netscape Communications
February 1997
(The "Standards Track" category means it is a summary and formalisation of de facto standards.)