How to get cookie expiration date / creation date from javascript? [duplicate]

It’s impossible. document.cookie contains information in string like this:

key1=value1;key2=value2;...

So there isn’t any information about dates.

You can store these dates in separate cookie variable:

auth_user=Riateche;auth_expire=01/01/2012

But user can change this variable.

Leave a Comment