wood burning stoves 2.0*
The moose likes JSP and the fly likes cookie problem with IE. how to disable them? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "cookie problem with IE. how to disable them?" Watch "cookie problem with IE. how to disable them?" New topic
Author

cookie problem with IE. how to disable them?

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Apparently, when using my application on Internet Explorer, everything is cached and the result are incorrect. In other words, the result are based on previous information. When I delete my cookies, it works ok.

Question: how can I ensure that *no* cookie will be used or, alternetavly, to delete the cookie when getting into a page.

thanks

PS
this doesn't happens on fireFox
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

Have you tried this in your JSP,

response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires", 0);


Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
*yes*, that works.

So, should I place it on every jsp page?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

What a mess that would be!

Better to use your front controller, or, if you're using a primitive application structure, a filter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
thank you sheriff, any good link (tutorial maybe)

thanks for the help
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

If you are using Struts, Add nocache="true" to your controller element.



If you are using own controller(Front Controller), You can set these header values before you forward it to your JSP.

For doing this in Filter, here is the tutorial - URL
 
Don't get me started about those stupid light bulbs.
 
subject: cookie problem with IE. how to disable them?
 
Similar Threads
cookie are the cashed in the browser ???
Cookie will not die
intentions of variable cookie on methods.
JavaScript cookie with Hash value
HFSJ Final mock Q