Flash, IE, and the HTTP_REFERER object

Bookmark and Share

I spent several hours the other day trying in vain to solve this problem and couldn't find much help online so I'm going to share. I have a website with a "Send this page to a friend" function on it. Users click a button and get taken to a form which inserts the URL of the page the user clicked from. This works by using the HTTP_REFERER server variable to grab the last page the user was on. It's a simple script and once I've used dozens of times before but in this case it would not work in IE. Firefox was no problem but Internet Explorer just didn't work. Several hours of tearing my hair out and I found the answer… The send to a friend button was part of a navigation bar that was created in Flash. When you click a link in Flash, it doesn't register in IE so the HTTP_REFERRR object shows up as blank. I'm not entirely sure if this is a bug or a "feature" but for whatever reason IE, Flash, and HTTP_REFERER do not mix. I tested this in both ASP.NET and PHP and it's the same. The IE user-agent just doesn't pick up the flash links.

Example: The button on top is a .gif image whereas the button on the bottom is a .swf. Both link to a page which displays the HTTP_REFERER variable. Using IE, click on both buttons and you'll see that the flash button doesn't behave as expected.

Image Button
Image Button

Flash Button

For those interested, my workaround was to pass the user's current page into the flash movie containing the send to a friend button. Clicking the button would then pass the value to the page as a querystring. I.e. send-to-friend.aspx?from=referring-page.html
It's not the most convenient solution but it works and I was able to meet the deadline and those are the only 2 things the client ever really cares about.

How did u did'it?
How u are getting referer from swf. I'm trying for over a week...PLS tell me

Nice solution if you own the page, but how about on someone else's page, or a site like MySpace which doesn't give a referrer and wont allow script? I am required to write an flash appy which can be embedded with an 'embed' tag and somehow get the http_referrer. In Firefox the ExternalInterface works fine, but in IE its a failure. I know this is an old thread, but I'm looking anywhere at this point. Any suggestions?

Posted by: | August 23, 2007 12:08 PM | Reply

This is just a shit! I've tested my website on Firefox, but then, when i change language by a flash button, on IE7 the referrer is the swf!
I have no words...

I'm seeing this exact same problem with IE and Flash. The referrer is the swf file and not the page it is on. That in itself is not a huge problem for me. However, when this comes to a Flash banner ad on our site, Google Analytics treats IE click-throughs on it as direct hits to the destination website and not a referral from our website. This is so frustrating! I don't know whether I should be blaming Flash or Google Analytics. The webserver log file on the destination website definitely shows the swf referral hit... so I don't know why Google won't handle that. If Adobe would just have Flash set the referrer to be the page it's on, I'm sure this problem would go away.

Anyone solved the problem?
I found this on Adobe's website : http://kb.adobe.com/selfservice/viewContent.do?externalId=b06f1712&sliceId=2

thx a lot, useful info (=

No TrackBacks
TrackBack URL: http://www.codescene.com/cgi-bin/mt/mt-tb.cgi/5

Leave a Comment

Free the web - Boycott Internet Explorer 6