Reputation: 23
Thanks for you help in advance.
I am trying to figure out the structure of the cookie file, more specifically i want to be able to determine the expiry time. From the cookies i have created they all appear to be in a standard format. Name, Value, website,followed by 5 numbers and a star. See example below.
name
value
www.website.co.uk/
1536
3041141504
30135951
1632526096
30135949
*
Obviously the expiry time is one of the numbers, the question is which one. From experiments I have determined that the first and fifth number don't seem to change. In a case where i generated three cookies at the same time with a 1000 second time difference i noticed that the fourth number appeared to increase by 2000 suggesting that this has a connection with the expiry time.
Can anyone confirm if i am heading in the right direction? And does any one know how i convert this to a human time and date(preferably in php but any language would give me a starting point)
thanks Jason
Upvotes: 1
Views: 283
Reputation: 23
I have figure out the answer. Thanks to everyone who responded.
The format of the the cookie in ie8 is:
name
value
website
flags-not entirely sure what this is
expiration time (low)
expiration time (high)
creation time (low)
creation time (high)
To convert these numbers into actual times you can use the following formula:
time = 1*10-7*(high*2^32+low)-1164447360
thanks again
Jason
Upvotes: 1
Reputation: 1074258
I am trying to figure out the structure of the cookie file...
There isn't one. It's entirely up to the browser where and how to store cookies on the client computer. You can certainly solve this for popular browsers, but it won't be the same solution for all of them. Some store cookies in flat files; others store them in individual files (per cookie, or per site), others as SQLite databases...
Upvotes: 2