Hmm, there seems to be no easy way to do this. JavaScript can only access name / value pairs, not additional information that can be set in a cookie.
After some searching, the closest thing to the solution I could find (technically this is a workaround) is that if you really need to have a cookie expiration date, then you can save it in another cookie. When you formulate an expiration date, set it as the expiration date of your target cookie and the value of another cookie.
For example, set NAME = BOB; expirationdate and NAME_EXP = expirateiondate; expirationdate
Synetech
source share