Thank you for  a quick response . I have tried to setMaxAge(-1) and
setMaxAge(0) but they are not expiring the cookie.
Even though I close all the browser windows. After retrieving the cookies
"cookInfo" by using loop I'm  using

    cookInfo.setMaxAge(0);
      OR
    cookInfo.setMaxAge(-1);

    cookInfo.setPath("/");
    response.addCookie(cookInfo);

But this does't work.What may be wrong?




----- Original Message -----
From: "Gokul Singh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 29, 2001 9:00 AM
Subject: Re: Porblem expiring cookies


> ----- Original Message -----
> From: "Mark Galbreath" <[EMAIL PROTECTED]>
>
>
> > Actually, setting it to -1 will remove it if it's set.  Setting it with
no
> > expire will expire it at the and of the session.
>
> Setting the value to -1 does not remove it. The cookie gets deleted when
the
> browser exits.
>
> The javadocs for cookie class say
>
>        A negative value means that the cookie is not stored persistently
>        and will be deleted when the Web browser exits. A zero value
>        causes the cookie to be deleted.
>
> Regds,
> Gokul
>
>
> >
> > Cheers!
> > Mark
> >
> > ----- Original Message -----
> > From: "Mukul Singh" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, June 28, 2001 3:34 AM
> > Subject: Re: Porblem expiring cookies
> >
> >
> > > Wouldn't setting max age to -1 expire it??
> > >
> > > -----Original Message-----
> > > From: Shuja Nawaz [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, June 28, 2000 4:27 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Porblem expiring cookies
> > >
> > >
> > > Hi,
> > >
> > > I have developed a website. The user has an option to set cookies to
> > > remember his  username and password
> > > by checking a checkbox (I'm setting the cookie to expire after a
month).
> > > Now if the user unchecks the checkbox how should I expire the cookies
> > > immediately.
> > > I've tried setMaxAge(0)  but it does't work.
> > >
> > > I shall be thankful if you can send me an example how to resolve my
> > problem.
> > >
> > > Thank you in anticipation.
> > >
> > >
> > >
> > > Thanks & Regards
> > > Shuwaz Abbasi.
> > > Software Developer.
> > > Ph # 5584677-8.
> > > www.visualsoft-inc.com.
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to