Is there a javascript or php code to remove browsing history?

In summary, you can use the history object in javascript to manipulate the browser's history and delete entries using the history.clear() method. There is no specific code in php to delete browsing history, but you can use javascript or other client-side languages. You can also use the history.pushState() and history.replaceState() methods to choose specific websites to remove from your browsing history. Deleting browsing history through code will not clear cookies and cache, and you can use the setInterval() method in javascript to automatically delete browsing history at a specific time.
  • #1
chrisalviola
80
0
I want to remove my clients browsing history every time they access new pages from my website. is there any code, i keep searching the net and i can't find one.
 
Technology news on Phys.org
  • #2
No. Javascript does not allow you to remove a persons browsing history. PHP is server side and doesn't involve the browser directly.
 
  • #3
chrisalviola said:
I want to remove my clients browsing history every time they access new pages from my website.
Why would you want to do this?

The client's browser and browser data is their property. Philosophically, what you are trying to do is misguided.
 

Related to Is there a javascript or php code to remove browsing history?

1. How can I delete my browsing history using javascript?

Yes, you can use the history object in javascript to manipulate the browser's history. You can use the history.clear() method to delete all entries in the browsing history.

2. Is there a specific code in php to remove my browsing history?

No, there is no specific code in php to delete browsing history. Php is a server-side scripting language and does not have access to the client's browsing history. You can use javascript or other client-side languages to manipulate the history.

3. Can I choose which specific websites to remove from my browsing history?

Yes, you can use the history.pushState() method in javascript to add a new entry to the history with a specific website. You can then use the history.replaceState() method to replace that specific entry with a different website. This effectively removes the original website from the browsing history.

4. Will deleting my browsing history using code also clear my cookies and cache?

No, deleting your browsing history through code will only remove the entries from the history. Cookies and cache are separate from browsing history and will not be affected.

5. Is it possible to delete my browsing history automatically at a specific time using code?

Yes, you can use the setInterval() method in javascript to set a timer and run a function at a specific time interval. In that function, you can use history.clear() to delete the browsing history automatically.

Similar threads

  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
21
Views
5K
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
1
Views
361
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
2
Views
716
  • Programming and Computer Science
Replies
5
Views
1K
  • Programming and Computer Science
Replies
9
Views
3K
  • Programming and Computer Science
Replies
3
Views
1K
Back
Top