>>>>> "Robert" == Robert Landrum <[EMAIL PROTECTED]> writes:
Robert> That's what the RFC says... But that's not the way that a browser
Robert> handles it. I don't know why browsers don't support the "standards,"
Robert> but that's not exactly the topic.
Robert> Every browser I've ever tested with, including LWP, lynx and AOL, have
Robert> supported relative Location headers.
No... they've never seen one in their life. See below.
Robert> If the W3 wants to document it incorrectly or change the unofficial
Robert> standard, then they are wasting their time.
Wait... let's start getting some terminology straight. Let's stop
talking about "relative" and "absolute" URLs with respect to the
Location: CGI response. That's just gonna confuse terminology.
If a CGI script sends out a Location: header that doesn't begin with a
protocol (like http: or ftp:), then it's an *internal* redirect.
For an internal redirect, the browser never sees the transaction. The
web server just does a "goto", picking up the new resource, delivering
the content to the browser AS IF IT WAS THE OLD URL. The browser
doesn't even know it happened (thus the problem I said earlier about
relative URLs in the delivered document being broken).
If there was a Set-Cookie header on this internal redirect, THE
BROWSER NEVER SEES IT.
If the CGI script instead sends a protocol first in the Location,
(like http://perltraining.stonehenge.com), that's an *external*
redirect, and turns into one of the headers sent to the browser, along
with a Set-Cookie if present. The *browser* then fetches the new URL
as a separate transaction.
Nearly always, what you want is an *external* redirect. The relative
URLs in the new document are correct, and cookies get set as needed.
If you are using an *internal* redirect, BE VERY VERY CAREFUL THAT
THIS IS WHAT YOU WANT. Nearly always... *never*.
Does that help?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!