Is it possible to stop a browser storing a URL in its history?

后端 未结 3 1767
我寻月下人不归
我寻月下人不归 2021-01-03 23:43

When a user clicks to a page using a link on a previous page, is it possible for the target page to, on its own accord, remove its own URL from browser history (without sign

3条回答
  •  温柔的废话
    2021-01-04 00:32

    In some circumstances, sending a 302 Found response and redirecting to another page could work. If you need to hide query string parameters, you could set a session cookie with them on the initial, redirected response, then use them to serve the response on the real page. Just remember to clear the cookie when you serve the page.

    But this is an entirely server-side way to do it, and while you can hide sensitive data, you'll still see some page on the domain in the history.

提交回复
热议问题