Stuart Hemming
Stuart Hemming

Reputation: 1663

what do each line in a cookie represent

I've spent a lot of time trying to figure out what the each line in a cookie represents and for the life of me, I can't find anything that describes the physical structure of a cookie on the client.

Given this example...

nanme
value
localhost/
1024
1985341056
30290189
4263017152
30216763
*

I know that the first line is the name of the cookie the 2nd is the value of same. The 3rd line represents the domain.

The 4th line seems, more often than not, to hold the value 1600 or 1024 although it does have other values. I have no idea what this actually represents.

Line 5 is a complete mystery.

Line 6 is, I think, the expires date.

Line 7, again, no idea.

Line 8, I think, might be MAX AGE?

Line 9 is clearly the delimiter.

Is there a grown-up who can fill in the gaps for me please?

Upvotes: 0

Views: 494

Answers (1)

Xenon
Xenon

Reputation: 3185

Assuming these are Internet Explorer cookies, the format is as follows:

  • Name
  • Value
  • Path
  • Flags (optional)
  • Expiration Time (low)
  • Expiration Time (high)
  • Creation Time (low)
  • Creation Time (high)
  • Delimiter (used to separate multiple cookie entries in a single file)

The expiration and creation times are in FILETIME format. You can find information on the FILETIME format here. Most importantly:

The FILETIME structure represents the number of 100-nanosecond intervals since January 1, 1601. The structure consists of two 32-bit values that combine to form a single 64-bit value.

Upvotes: 1

Related Questions