asp清除浏览器历史记录代码

本文提供了一段用于清除浏览器历史记录的JavaScript代码,该方法适用于用户登出时清除浏览器缓存和历史浏览记录,确保信息安全。此外,还介绍了如何设置HTTP响应头来避免页面被缓存。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Code to clear browser history

/* This logout.asp is used to clear the back pages of the browser,
/* if the user has logged out.
/* if there are no specific vbscripting to be done then you can
/* use this file as logout.htm

<%
    /* Clear all your sessions over here and do other
    /* desired things
%>

<SCRIPT LANGUAGE=javascript>
{
    var Backlen=history.length;
    history.go(-Backlen);
    top.window.location.href ="../esadmin/administer.asp";
}
</SCRIPT>


    /* here the "../esadmin/administer.asp" page is the
    /* desired page to be displayed after the user logs out

To use the code above, click and drag your mouse over the code to highlight it.   Then right click on the
highlighted code and click "Copy."   Now you may paste it into your code editor.

<%    
  Response.Buffer   =   True    
  Response.ExpiresAbsolute   =   Now()   -   1    
  Response.Expires   =   0    
  Response.CacheControl   =   "no-cache"    
  %> 
 fromASP文章

其他文章:

ASP 编程中20个非常有用的例子[转]

在ASP中调用dll

软件构件技术在MIS开发中的应用

利用XML穿越防火墙

WINDOWS程式设计--动态链接库(2)

Hooks(钩子)监听消息的方法

aspjpeg组件高级使用方法介绍

海量数据库的查询优化及分页算法方案

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值