More safe conversion of the expire variable

It's not guaranteed that there is a Date object in the data.cookie.expires var