在AJAX会话超时响应 [英] Session timeout response in AJAX

查看:236
本文介绍了在AJAX会话超时响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,我使用AJAX我装了一些表。但是,当用户的会话超时它给了我登录页面,获取表区域加载的响应。

In my application, I'm loading some table using AJAX. But when user's session times out it gives me login page as response that gets loaded in table area.

我想重定向时,会话超时AJAX调用期间出现登录页面可能在JavaScript。

I would like to redirect to login page may be in javascript when session timeout occurs during AJAX call.

推荐答案

在渲染登录页面,你可以追加到响应的自定义HTTP标头: X-的login-page:真。然后执行您的AJAX调用并为您的成功回调这个自定义标题的presence。采取相应的行动,如果present。

When rendering the login page you could append a custom HTTP header to the response: X-LOGIN-PAGE: True. Then perform your AJAX call and check for the presence of this custom header in the success callback. Act accordingly if present.

这篇关于在AJAX会话超时响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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