我需要以下代码“如果我点击浏览器的后退按钮,网站应该注销”在ASP.NET中 [英] I need code for the following "If i click the back button of a browser the website should logout" in ASP.NET

查看:56
本文介绍了我需要以下代码“如果我点击浏览器的后退按钮,网站应该注销”在ASP.NET中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我点击浏览器后面的按钮,网站应该注销

解决方案

Nope。不可能远程。修复您的代码,使其不会缓存登录页面。您无法控制后退按钮,您的页面将像以前一样刷新,任何尝试使后退按钮注销都将充满危险和愚蠢的设计。


帮助我解决以下问题



如果我点击浏览器后面的按钮,网站应该退出





在navigateLogin函数中,将ajax调用写入某个服务器端函数以清除会话并导航到登录页面。







在navigateLogin功能中,导航到登录页面并在登录页面加载时终止会话。







< title>



function navigateLogin(){

//在这里写ajax电话

}





















If i click the back buton of a browser the website should logout

解决方案

Nope. Not remotely possible. Fix your code so that it doesn''t cache logged in pages. You can''t control the back button, your page will refresh same as before and any attempt to make the back button log out will be fraught with danger, and dumb design.


help me to solve the below problem

If i click the back buton of a browser the website should logout


Hi,

In navigateLogin function, write ajax call to some server side function to clear your session and navigate to login page.

or

In navigateLogin fuction, navigate to login page and kill the session on the login page load.



<title>

function navigateLogin() {
//write ajax call here
}











这篇关于我需要以下代码“如果我点击浏览器的后退按钮,网站应该注销”在ASP.NET中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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