0

I am trying to have a jquery/javascript code to clear site data of chrome devtool. I found so many similar questions asked by other developers but didn't found any working solution so far. Here is the similar question asked, but the solution is unknown.

I am stuck in a situation where I want the site data should be cleared automatically by any way. I need to clear cookies, cache, Indexed DB, localstorage, session storage. I know localStorage.clear() and sessionStorage.clear() and these functions return undefined.

I checked this solution but it seems this not a solution.

Can anyone have any workaround to achieve this? It would be a great help for me.

Thanks!

DevD
  • 304
  • 1
  • 4
  • 11
  • You can't clear cache in JS, also you can't clear cookies marked with `HTTPOnly`. The mentioned storage clearing methods will clear the storages, the return value of the methods is `undefined`, they're not supposed to return anything. – Teemu Dec 02 '22 at 07:20

0 Answers0