How to read the cookie creation date (not expiration)

Mario Lima Cavalcanti picture Mario Lima Cavalcanti · Jul 18, 2013 · Viewed 11.4k times · Source

Is there a way to store in a variable a cookie creation date? I'm using the jquery.cookie plugin. If there is not a way, I'm thinking about store in the cookie, as value, the actual time/date. It could be a solution.

Thanks.

Answer

Ulrich Schmidt-Goertz picture Ulrich Schmidt-Goertz · Jul 18, 2013

You will indeed have to store the time in the cookie itself. The browser's cookie API does not supply the creation date as metadata.