JavaScript 相当于点击浏览器刷新按钮
我正在向旧版 Web 应用程序添加功能,以便在某些情况下我们将注销用户,将他们返回到与我们的应用程序分开的登录页面。
该应用程序部分是经典 ASP,部分是 ASP.NET,并使用外部公司范围的身份验证机制。
我们可以通过清除浏览器中的会话cookie并点击浏览器刷新按钮来达到预期的效果(实验性地)。底层身份验证机制将用户重定向到登录页面,当他们输入凭据时,他们会被引导回原来所在的页面。
我们目前正在使用以下方法...
function logoffUser() {
$.cookie("ASP.NET_SessionId", null);
$.cookie("ASPSESSIONKEY", null);
$.cookie("CompanyFormsAuth", null);
window.location.reload(true);
}
只要用户弹回到外部登录页面,这种方法就有效。但是,浏览器地址栏中显示的地址不会更新,当他们登录时,他们最终会出现在我们应用程序的主页上。
所以根本问题是:是否有一个 JavaScript 相当于点击浏览器刷新按钮?
I am adding functionality to a legacy web application such that in certain circumstances we will log the user off, returning them to a logon page that is separate to our application.
The application is part classic ASP, part ASP.NET and uses an external company-wide authentication mechanism.
We can achieve the desired effect (experimentally) by clearing session cookies in the browser and hitting the browser refresh button. The underlying authentication mechanism redirects the user to the logon page and when they enter their credentials they get directed back to the page they were originally on.
We are currently using the following approach...
function logoffUser() {
$.cookie("ASP.NET_SessionId", null);
$.cookie("ASPSESSIONKEY", null);
$.cookie("CompanyFormsAuth", null);
window.location.reload(true);
}
This works, insofar as the user gets bounced back to the external logon page. However the address shown in the browser address bar does not get updated, and when they logon they end up on our application's home page.
So the fundamental question is: Is there a JavaScript equivalent to hitting the browser refresh button?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这将“刷新”当前页面
This will "refresh" the current page