admin管理员组文章数量:1291124
I have a jquery Ajax call implemented for keepalive the session, this keepAlive() method will call in every 20 mins
function keepAlive() {
$.ajax({ type: "POST",
url: "KeepAliveDummy.aspx", cache: false
});
}
This call is happen when the third party contents are loaded in to the frameset,
I'm getting 403 http status (check via fiddler) on this request, Will this impact the end result of refresh the session time out?
I have a jquery Ajax call implemented for keepalive the session, this keepAlive() method will call in every 20 mins
function keepAlive() {
$.ajax({ type: "POST",
url: "KeepAliveDummy.aspx", cache: false
});
}
This call is happen when the third party contents are loaded in to the frameset,
I'm getting 403 http status (check via fiddler) on this request, Will this impact the end result of refresh the session time out?
Share Improve this question asked Feb 24, 2014 at 5:12 KRRKRR 5053 gold badges6 silver badges23 bronze badges 3- 2 http status 403 is forbidden,check whether its CORS issue – Cris Commented Feb 24, 2014 at 5:15
- en.wikipedia/wiki/HTTP_403 – Deepak Ingole Commented Feb 24, 2014 at 5:15
- use dataType and contentType in your ajax call.. may be it will helped you. – angfreak Commented Feb 24, 2014 at 5:18
2 Answers
Reset to default 6Since your question is about handling 403 error (Will this impact the end result of refresh the session time out?) rather what 403 is.
So, handle this error, you can log or notify.
$.ajax({
type: "POST",
url: "KeepAliveDummy.aspx",
success: function (response) {
//session refreshed
},
error: function (xhr, ajaxOptions, thrownError) {
if(xhr.status==403) {
//handle error
}
}
});
about 403 :
403 Forbidden The request was a valid request, but the server is refusing to respond to it.[2] Unlike a 401 Unauthorized response, authenticating will make no difference.[2]
it needs you to authenticate (like login) first before do call ajax. 401 error requires authenticating header field when request but 403 doesn't.
check your server or contact who has responsibility for authentication.
本文标签: javascriptJquery Ajax call return 403 statusStack Overflow
版权声明:本文标题:javascript - Jquery Ajax call return 403 status - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741512432a2382682.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论