302 找到响应
我已经实现了 ajax 请求来填充我的下拉字段。它工作正常,但是当我闲置一段时间并在下拉列表中选择某个值时,ajax 请求会收到 302 找到的响应。是否是由于会话超时。请让我知道解决方案,我们可以做一些设置,使它永远不会得到 302 发现的响应。
I have implemented ajax request to populate my drop down fields. It is working Fine but when I stay idle for some time and select some value in drop down the ajax request gets 302 found response. Is it due to session out. Please let me know the solution, can we do some setting that it will never get response as 302 found.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的代码中,您应该检查会话是否可用,
因为当发送 GET/POST 请求时,可能会有额外的图像或其他资源请求。会话将无法满足这些请求。
In your code you should check whether a session is available,
because when a GET/POST request is sent, there may be additional requests for images or other resources. Sessions won’t be available for those requests.
302状态码表示您正在请求的资源已重定向到另一个资源。如果这是在某些身份验证后面,或者需要会话处于活动状态,那么是的,会话超时会导致调用 ajax 资源以重定向到可能的登录屏幕。
我强烈建议使用 Charles 或 Fiddler 之类的东西> 跟踪发出的请求。
The 302 status code indicates that the resource you are requesting has redirected to another resource. If this is behind some authentication, or requiring a session to be active then yes, it would follow that the session timing out is responsible for the ajax resource being called to redirect to possibly a login screen maybe.
I would seriously recommend using something like Charles or Fiddler to track the requests being made.