Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

how to delete cookie and temporary internet files using java

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I wrote a JSP page after sucessfully logging into the application. In that JSP page i have a logoff option. When user clicks on logoff button all the cookis and temporary internet files for that particluar browser, i want to delete it.
So can any one please help in writing that peace of java code??

Thanks well in advance.

Shrikant
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JSP is run on the server and outputs a HTTP response, probably made up of HTML but possibly binary content instead. Whatever this content is, only it gets sent to the client and only it could possibly effect the broowser cache (or the HTTP header, but we'll get to that).

So on the client, you want something which runs on the client side to clear the cache for the current site. I'm pretty sure it can't be done and the security measures would block you. However if all communication was in HTTPS and the user had the option selected to prevent caching secure content set then the cache wouldn't exist, but again you can't enforce this setting. If you had already specified that each piece of content should not be cached as you sent it to the client it would not be cached, but this requires setting HTTP headers to instruct the browser not to cache the content.

With respect to cookies, if it is a session cookie it should be memory only and not resident. You can get all of the cookies from the request and set them to expire immediately and they'll disappear. It's all in the API and can be done on the server.

Dave
 
Danger, 10,000 volts, very electic .... tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic