Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cookie problem with IE. how to disable them?

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried this in your JSP,

response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires", 0);
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*yes*, that works.

So, should I place it on every jsp page?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What a mess that would be!

Better to use your front controller, or, if you're using a primitive application structure, a filter.
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you sheriff, any good link (tutorial maybe)

thanks for the help
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic