dcsimg
How do I delete a cookie from the current request? (not in the browser)
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Larry_Rosen
Posted On:   Sunday, November 18, 2007 07:51 PM

By now we all know to delete cookies in Java we set the maxage to 0 and add it to the response back to the browser. That doesn't "delete" a cookie but tells the browser to expire the cookie. But what I want to do is remove a specific cookie from the current request so that if in some other method I call: Cookie[] c = request.getCookies(); c should no longer contain the specific cookie. I want to modify the current request. I can't just remove the cookie from the array c and then pass c to the other method. The other method is not in my code, it's in a library, and it gets the cookies from the request.    More>>


By now we all know to delete cookies in Java we set
the maxage to 0 and add it to the response back to the browser. That doesn't "delete" a cookie but tells the browser to expire the cookie. But what I want to do is remove a specific cookie from the current request so that if in some other method I call:


			
Cookie[] c = request.getCookies();


c should no longer contain the specific cookie.
I want to modify the current request.
I can't just remove the cookie from the array c
and then pass c to the other method. The other
method is not in my code, it's in a library, and
it gets the cookies from the request.

   <<Less
About | Sitemap | Contact