Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are seeing some Safari browsers failing to cross-authenticate our website after we upgrade to .net 4.0 from .net 3.5.

After much investigation, it turns out to be a problem with ASP.Net identifying the Safari browsers properly. ASP.Net identifies some Safari (possibly other AppleWebKit-based browsers) as Mozilla Version 0.0. browsers that do not support cookies, frames, javascript, etc. .Net 3.5 does not have any problems identifying these browsers.

We have simplified testing down to a simple http handler (running on a vanilla 4.0 website) that only returns the browser capabilities of the requestor.

Here are a few User-Agents that fail to be Identified (they are identified as Mozilla 0.0):

  • Mozilla/5.0+(Macintosh;+U;+Intel+Mac+OS+X+10_5_8;+en-us)+AppleWebKit/533.19.4+(KHTML,+like+Gecko)+Version/5.0.3+Safari/533.19.4
  • Mozilla/5.0+(Macintosh;+U;+Intel+Mac+OS+X+10_6_2;+en-us)+AppleWebKit/531.9+(KHTML,+like+Gecko)
  • Mozilla/5.0+(Macintosh;+U;+Intel+Mac+OS+X+10_6_7;+en-us)+AppleWebKit/533.20.25+(KHTML,+like+Gecko)+Version/5.0.4+Safari/533.20.27
  • Mozilla/5.0+(Macintosh;+U;+Intel+Mac+OS+X+10_6_6;+en-us)+AppleWebKit/533.18.1+(KHTML,+like+Gecko)

The handler code looks like this:

<%@ WebHandler Language="C#" Class="TemporaryHandler" %>

using System;
using System.Web;
using System.Web.Security;

public class TemporaryHandler : IHttpHandler
{
public bool IsReusable
{
    get { return true; }
}

public void ProcessRequest(HttpContext context)
{

            HttpBrowserCapabilities hbc = context.Request.Browser;
    context.Response.Write("Type=" + hbc.Type + "<br>");
    context.Response.Write("Name=" + hbc.Browser + "<br>");
    context.Response.Write("Version=" + hbc.Version + "<br>");
    context.Response.Write("Major Version=" + hbc.MajorVersion + "<br>");
    context.Response.Write("Minor Version=" + hbc.MinorVersion + "<br>");
    context.Response.Write("Platform=" + hbc.Platform + "<br>");
    context.Response.Write("Is Beta=" + hbc.Beta + "<br>");
    context.Response.Write("Is Crawler=" + hbc.Crawler + "<br>");
    context.Response.Write("Is AOL=" + hbc.AOL + "<br>");
    context.Response.Write("Is Win16=" + hbc.Win16 + "<br>");
    context.Response.Write("Is Win32=" + hbc.Win32 + "<br>");
    context.Response.Write("Supports Tables=" + hbc.Tables + "<br>");
    context.Response.Write("Supports cookies=" + hbc.Cookies + "<br>");
    context.Response.Write("Supports VBScript=" + hbc.VBScript + "<br>");
    context.Response.Write("Supports Frames=" + hbc.Frames + "<br>");
    context.Response.Write("Supports JavaScript=" + hbc.EcmaScriptVersion.ToString() + "<br>");
    context.Response.Write("Supports Java Applets=" + hbc.JavaApplets + "<br>");
    context.Response.Write("Supports ActiveX Controls=" + hbc.ActiveXControls + "<br>");
    context.Response.Write("User Agent=" + context.Request.UserAgent + "<br>");
}
}

We are bewildered as to the lack of mention on the Internet about this problem. It seems that we need to add Browser defintions either to the framework/config/browsers folder or else to the App_Browsers folder at the website level, but it seems bizarre that we would need to tweak Browser defs for a .net 4.0 website to run properly.

Anyone have any experience with this issue?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.