I want a cookie to expire in 10 minutes precisely (just for the sake of argument).
If I use Expires = DateTime.Now.AddMinutes(30)
and user is 3 hours behind me, cookie will expire as soon as it is received (is this correct?)
How do I set expiration so it is local to user?
Sure, I can use JavaScript to send that info together with the request, or use a JS-library of some sort to create cookie on the client side, or keep user profile and ask user for time zone, but I am looking a lazy-man solution.
The cookie expiration date will end up as a GMT time, so your code will simply work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With