I would like to take a Cookie string (as it might be returned in a Set-Cookie header) and be able to easily modify parts of it, specifically the expiration date.
I see there are several different Cookie classes, such as BasicClientCookie, available but I don't see any easy way to parse the string into one of those objects.
I see in api level 9 they added HttpCookie which has a parse method, but I need something to work in previous versions.
Any ideas?
Thanks
The cookie parser parses cookies and puts the cookie information on req object in the middleware. It will also decrypt signed cookies provided you know the secret. Follow this answer to receive notifications.
Just call document. cookie to retrieve the current value of all cookies. You can then store this value in a variable for further manipulation.
How about java.net.HttpCookie
:
List<HttpCookie> cookies = HttpCookie.parse(header);
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