views:

28

answers:

1

How can i get the latest cookie sent from a domain ?

eg : cookies 1 - ABC 2 - ABC123 3 - ABC456

These 3 cookies has been sent from a domain, how do i find which one is the latest one?

Thanks.

+1  A: 

From Wikipedia:

Beside the name/value pair, a cookie may also contain an expiration date, a path, a domain name, and whether the cookie is intended only for encrypted connections. RFC 2965 also specifies that cookies must have a mandatory version number, but this is usually omitted.

So you can:

  • Check the version number, if there is one
  • Check the expiration date, assuming it's being set based on current time + some amount

As far as I know, that's all you can do. If you're involved in setting the cookie, you can put the information you need into one of the properties above when you set it.

Nathan Long
I was writing the same answer
Pedro Ladaria