File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes cookies Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "cookies" Watch "cookies" New topic


Kranthi Kondapaka
Ranch Hand

Joined: Sep 17, 2007
Posts: 31
this is my method
private void deleteCookie(HttpServletResponse response, String cookie) {
Cookie c = new Cookie(cookie, null);
c.setMaxAge( 0 );
c.setPath( "/" ); // for all subdirs

I am calling it from my action class.
After executing it also,m unable to delete the cookie,i mean unable to set the maxAge=0;

anyone help me out
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

I don't understand. Why not?
Ajith Prasad
Ranch Hand

Joined: Aug 22, 2006
Posts: 66
It is working perfectly with IE
I agree. Here's the link:
subject: cookies
It's not a secret anymore!