I've integrated the Windows Live SDK into a prototype for my blog rewrite. Unfortunately, it's not handling the Logout calls correctly. According to the SDK Documentation, I should be able to accomplish a Logout with the following code:
HttpCookie loginCookie = new HttpCookie("webauthtoken");
loginCookie.Expires = DateTime.Now.AddYears(-10);
Response.Cookies.Add("webauthtoken");
Response.Redirect("default.aspx");
Response.End();
Unfortunately, Response.Redirect and Response.End don't work when your ASP.NET application also happens to be running AJAX. As a result, the Windows Live logout page reports it was unable to log out of the website. I have verified this code is being run.
Further, the "clearcookie" function call has similar problems, as it wants to return a GIF for some odd reason:
HttpCookie loginCookie = new HttpCookie("webauthtoken");
loginCookie.Expires = DateTime.Now.AddYears(-10);
Response.Cookies.Add("webauthtoken");
string type;
byte[] content;
wll.GetClearCookieResponse(out type, out content);
Response.ContentType = type;
Response.OutputStream.Write(content, 0, content.Length);
Response.End();
How can I accomplish this correctly without sacrificing the AJAX functionality?