Hi,
I'm using the CookieManager in my programm and found the following.
Adding of a Cookie is done in milliseconds (current time in milliseconds + a
day in milliseconds). A day seems to be the wanted default expiration time.
---schnipp---
Cookie newCookie =
new Cookie(
name, value, domain, path, false,
System.currentTimeMillis() + 1000 * 60 * 60 * 24);
---schnapp--
Getting a Cookie is done with current time in seconds compared to expiration
value in milliseconds
---schnipp---
if ( url.getHost().endsWith(cookie.getDomain()) &&
url.getFile().startsWith(cookie.getPath()) &&
(System.currentTimeMillis() / 1000) <= cookie.getExpires() )
---schnapp--
Is this the wanted behaviour?
I changed it to:
---schnipp---
if ( url.getHost().endsWith(cookie.getDomain()) &&
url.getFile().startsWith(cookie.getPath()) &&
System.currentTimeMillis() <= cookie.getExpires() )
---schnapp--
This works for me.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>