In LiveId Web Auth scenario, when client application receive "clearcookie" request, it is responsible for clearing the authorization cookies and should confirm success by returning any GIF image through http. Using reference implementation of liveid web auth in asp.net-mvc looks like:
if (Request["action"]=="clearcookie")
{
string contentType;
byte[] content;
wll.GetClearCookieResponse(out contentType, out content);
return this.File(content, contentType);
}
Where wll.GetClearCookieResponse is implemented as:
public void GetClearCookieResponse(out string type, out byte[] content)
{
const string gif =
"R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAIBTAA7";
type = "image/gif";
content = Convert.FromBase64String(gif);
}
So the GetClearCookieResponse method creates byte[] array containg tiny hardcoded GIF.
Is there any particular reason why responding with GIF is required? Why not just plain text ("OK") or JSON?
Are there any other (than LiveId) protocols using returning GIF as a response? I'm asking because I want to know if there is any reason to adopt this solution in projects requiring similar scenarios of communication.