Posted: Tue Aug 23, 2005 11:23 pm Post subject: Re: sending referer
Anonymous wrote:
Ok it seems that clicking links from within an MSN Messenger chat window doesnt send a referer with it. Now that I understand and its ok.
So I create a link to a page on my site that makes a redirect, hoping it will send a referer, but it doesnt!! How can I send a referer along?
Some web browsers just don't send referers. Some browsers have settings that can be set to not send them (I've seen a few IE 6 users on my site who don't send referers at all, when other IE 6 users do send them).
That, and referrers are in no position to be used as any kind of authentication (i.e. "if you came from this page, you're authorized to use this other page") because referrers can be fabricated. For example, LWP::UserAgent can grab a page via the POST method, send any form-data it wants to, while also b/s'ing a cookie and a referring URL, and the web server would think it was just another user behaving just as they should.
If you want something to check if they were sent there from MSN or from the web, you can use Perl as a CGI or use PHP...
Quick Perl CGI example:
Code:
#!/usr/bin/perl -w
use strict;
use warnings;
use CGI;
# Create a new CGI object.
my $cgi = new CGI();
# Get the sending location.
my $sender = $cgi->param ("from") || 'web';
Then you can print out HTML stuff (print "Content-Type: text/html\n\n" first) and do whatever you want based on $sender
And when "from" isn't there it's assumed to be 'web'
And on a last note, MSN and other programs don't send referrers because there is no URL for you to return to, and they're not web browsers, etc. _________________ Current Site (2008) http://www.cuvou.com/