1

I set a cookie for users before I redirect them to any company partner pages.

A web beacon is fired by our partners on their respective domains later at some point after the hand-off (for us to track referrals) to a handler which reads that cookie.

The following code works fine in Firefox, but IE8 and up (and possibly other versions) return null every time.

1) my domain -> aspx page sets cookie:

HttpCookie cookie = new HttpCookie(name);
cookie.Value = value;
cookie.Expires = DateTime.Now.AddDays(5);
Response.Cookies.Add(cookie);
//now redirect to partner page

2) partner domain -> fire web request through ajax or script tag implementation

<script type='text/javascript' src='http://mydomain.com/handler.ashx'></script>

3) my domain -> ashx handler receives request and attempts to read cookie in ProcessRequest

if (context.Request.Cookies[name]!=null){ //note use of handler context to access cookie
    //get cookie Works with firefox FAILS  with ie
}

I even added a p3p header to the handler to avoid the evil eye of IE's cookie-blocking Sauron in the status bar assuming a correlation. That did allow me to use session, but I need the persistence of a cookie for my purpose, so it was no help.

Update I performed the same test, but using an aspx page rather than ashx to rule out any handler issues. The problem still exists!

One other thing to note is that with both ashx and aspx called from 3rd party page, ie will still display the aforementioned 'Restricted Websites' eye icon, much the same way it does on this site when viewed in IE. (my privacy settings are set to the default of medium)

kona
  • 139
  • 8

0 Answers0