Of course. But I use the CookieManager in a different application and was astonished to see the CookieManager adding a day to the current time and then comparing seconds against milliseconds. It is a little bit like wearing braces AND a waistbelt.
Tom Am Freitag, 20. September 2002 21:37 schrieb Mike Stover: > Well, that's kind of funny. It essentially just means cookies will never > expire so far as JMeter is concerned. I trust JMeter worked for you either > way? > > -Mike > > On 21 Sep 2002 at 0:19, Tom Wiedenh�ft wrote: > > 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]> -- Tom Wiedenh�ft Falkenstr. 6a, 81541 M�nchen Tel: 089-21939574 Tel: 0163-6702011 Web: http://www.tom-wiedenhoeft.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
