This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Struts and the fly likes how to delete/remove cookies ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to delete/remove cookies ?" Watch "how to delete/remove cookies ?" New topic

how to delete/remove cookies ?

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
I have an object in session and when retrieve it and populate it into the form, some previously information are displayed.
(This happens only on Explorer)

I do this: Tools->internet Option-->delete->delete cookies ...refresh and I see the real object's data (the one I requested) in the form

Question: How to avoid that or delete the cookies before populating it into the form? should that be done in the view/jsp or action?

Rusty Smythe
Ranch Hand

Joined: Aug 09, 2006
Posts: 93

More importantly, why are you using cookies to store application data?

Cookies are
1) Not reliable - may or may not exist
2) Not secure - may or may not be changed by the user

Google something like "clear cookies javascript" for the answer to your question.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
It could also be that the session id is what is being stored as a cookie (this is very common). By deleting your cookies, you will get a brand new session the next time you hit a page. If you are storing your forms in session, I suspect that this is the cause of you problem.

- Brent
It is sorta covered in the JavaRanch Style Guide.
subject: how to delete/remove cookies ?
It's not a secret anymore!