Skip to content Skip to sidebar Skip to footer

Jquery Ajax Call Return 403 Status

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',

Solution 1:

Since 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
        }
      }
    });

Solution 2:

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.

Post a Comment for "Jquery Ajax Call Return 403 Status"