perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Smith <>
Subject Re: Intermittent Error - Setting Cookies on POST request redirect response
Date Fri, 09 May 2003 08:10:24 GMT
On Thu, 8 May 2003, Michael Koob wrote:

> I am curious if anyone has experienced this type of error. The first in
> a series of forms is submitted. If the first form is successfully
> submitted a cookie is set and the user is redirected to the next page in
> the series. I have noted an error that has been difficult to diagnose.
> Some browsers after successfully submitting the form are redirected to
> the second page. The second page after noting that no cookie is present
> redirect the user back to the first page. Investigation shows that the
> request was successfully processed as expected since the browser was
> redirected. However, the cookie was not sent/set.

If you do a redirect to the same server without explicitly including the
domain, apache short cuts the request, and doesn't send it back to the
browser, but just executes and returns the contents of the page redirected
to. This speeds up redirects considerably.... but it means (a) cookies
aren't set, (b) in some browsers the URL doesn't change.

To get round this you must specify the full URL including domain etc in
the location header, then the cookie will be set.


It took me a long time to work this out - and quite some time learning
about Apache to find out what it was....

View raw message