Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear browsers (IE, Firefox, Opera, Chrome) history using JavaScript or Java except from browser itself?

How to clear browsers (IE, Firefox, Opera, Chrome) history using JavaScript or Java, except clearing it from browser itself?

like image 453
Yogi Avatar asked Feb 03 '10 09:02

Yogi


Video Answer


1 Answers

There's no way a browser will let you clear its cache. It would be a huge security issue if that were possible

What you can do is to tell it not to cache your page, by sending the appropriate headers or using these meta tags:

<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>

I would like to point out that if you are working with sensitive data you should be using SSL. If you aren't using SSL, anyone with access to the network can sniff network traffic and easily see what your user is seeing.

Using SSL also makes some browsers not use caching unless explicitly told to. See this question.Will web browsers cache content over https

like image 149
Abhinay Reddy Keesara Avatar answered Oct 03 '22 20:10

Abhinay Reddy Keesara