返回按钮以及登录和会话问题 [英] Back button and Login and Session Problem

查看:81
本文介绍了返回按钮以及登录和会话问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web应用程序,应在其中自定义浏览器的后退按钮功能.就像,每当我们单击浏览器的后退按钮时,它应该带我们到登录页面(登录页面),它应该显示错误消息,指出会话已过期.请重新登录''.
< script type ="text/javascript">
函数noBack(){
window.history.forward()}
noBack();
window.onload = noBack;
window.onpageshow = function(evt){
if(evt.persisted)noBack()}
window.onunload = function(){
void(0)}</script>

我在onClientClick中的注销"按钮中将此JavaScript代码称为.但这适用于Web应用程序的所有其他页面,即使在静态页面中也是如此.我要删除浏览器历史记录,仅注销按钮单击.请Reply.Reply.Reply.

I have a web application, in which browser''s back button functionality should be customized. It''s like, whenever we click on browser''s back button, it should take us to landing page(Login page), It should display error message saying that ''session expired. Please login again''.
<script type="text/javascript" >
function noBack(){
window.history.forward()}
noBack();
window.onload=noBack;
window.onpageshow=function(evt){
if(evt.persisted)noBack()}
window.onunload=function(){
void(0)} </script>

i call this javascript code in onClientClick in Logout button. but this works in all other pages in web application even in static page also. i want to delete browser history only logout button click. Please Reply.Reply.Reply.

推荐答案

更好的IMO设计是在呈现页面时清除浏览器历史记录,以便禁用后退按钮并提供注销功能.
A better design, IMO, would be to clear the browser history when the page is rendered so the back button is disabled and provide a logout feature.


这篇关于返回按钮以及登录和会话问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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