I'd like to know how you can get the expiration time of a Flask cookie. For setting it, I have the following code:
resp.set_cookie('id', my_id
expires = current_time + current_time + datetime.timedelta(days=30))
However, I am having difficulties getting that value back.
I think we cannot, according to Microsoft's explanation of how ordinary browsers work.
The browser is responsible for managing cookies, and the cookie's expiration time and date help the browser manage its store of cookies. Therefore, although you can read the name and value of a cookie, you cannot read the cookie's expiration date and time
https://msdn.microsoft.com/en-us/library/ms178194(v=vs.100).aspx
A question "How to get cookie's expire time" refers to the same problem, and the way of putting expiration date into a cookie's value is shown in one of the answers.
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