Error Loading Page on log out

Error Loading Page on log out

Hi,
 
I am using ASP.NET Forms Authentication for my mobile app site. The login process works fine, but I am having a slight issue with the logout.
 
The logout method is a server side method in a .asmx file in the project. To call it, I'm using the following code:
 

function SignUserOut() {

$.ajax({
      type:
"POST" ,
      url:
"Services/LogOutService.asmx/LogUserOut" ,
      data:
"" ,
      contentType:
"application/json; charset=utf-8" ,
      dataType:
"json" ,
      success:
function (msg) {
            window.location.replace(
"default.aspx" );
      },
      error:

function (x, e) {
            alert(
"The call to the server side failed. " + x.responseText);
      }
});
}


 
The logout process seems to work, however I am getting a brief error 'Error Loading Page' after I click the logout button. This only lasts a second or two before the page refreshes with the logout complete.
What's strange is that this only happens sometimes. Other times, it works perfectly.
 
I know it's a bit vague, but can anyone hazard a guess as to what the problem might be?