注销时如何从浏览器中删除历史记录 [英] How to remove history from browser when logout

查看:116
本文介绍了注销时如何从浏览器中删除历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在注销应用程序后删除历史记录和缓存.我在页面加载时关闭了缓存功能.但是注销后,当我按后退"按钮时,由于缓存已删除,它将显示已过期的网页.

任何人都可以告诉我如何在使用asp.net注销时删除历史记录.

谢谢,

I want to remove history and cache after log out the application. I set the cache functionality off on page load. But after log out when i press back button then it will display webpage expired because of cache removed.

Can Anyone Tell me how to remove history on log out with asp.net.

Thanks,

推荐答案

看看这个技巧,它应该对您有帮助:
Have a look at this tip, it should help: Browser back button issue after logout[^]


写这些链接以清除cs页面中的会话.
Write these link to clear the session in the cs page.
Session.Abandon();
        Session.Contents.RemoveAll();
        FormsAuthentication.SignOut();


并在aspx页面中写


and write in aspx page

<script type="text/javascript" >        history.forward();
    </script>



这些代码将清除所有会话和浏览器历史记录,以使浏览器的后退按钮不起作用.



these code will clear all the session and browser history so that back button of the browser will not work.


请尝试以下操作:-

通过输入以下计算机语言代码,
Try This :-

Begin the new script by entering in the following computer language code:

protected void logout()

{

This code tells the computer to initiate this code anytime the Web browser is closed.


Create the following code immediately under the code listed in Step 1:

session.abandon();

string nextpage="logout.aspx";

response.write (<script language=javascript>);


Type directly under the code provided in Step 3 the following language:

response.write (var backlen= history.length;);

response.write (window.location.href=' +nextpage+ ';);


Enter the code below to conclude the programming of your automatic history-clearing program:

response.write (</script>)

}


这篇关于注销时如何从浏览器中删除历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆