perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Koob" <mich...@michaelkoob.com>
Subject Intermittent Error - Setting Cookies on POST request redirect response
Date Thu, 08 May 2003 17:47:50 GMT
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.

Yes the cookie is being set in the error headers :) This error is only
intermittent and is experienced on about 25% of the requests. Here is
some of the relevant code:

my $reg = Session::ProRegistration->new( accountId => $acct );
#Subclass of my own configruable session objects

#Create session and set cookie
$reg->save;				#saves to database
$reg->setCookie;			#calls Apache::Cookie->bake
method

$apr->err_headers_out->set( 'Location' => $successURL );
return REDIRECT;

What is even better is that each browser has is tested for cookie
acceptance before being given access to this page via setting a cookie
and redirecting and testing for the cookie at the redirection url. So we
know that the browser can and does accept cookies. At least on GET
requests anyway:) A review of the logs indicates that the redirection is
seen by the browser but the cookie is not:

67.81.102.81 - - [08/May/2003:12:36:39 -0400] "GET
/register/professional/account.htm HTTP/1.1" 302 379
"http://www.bigfivepros.com/professional/index.htm" "Mozilla/4.0
(compatible; MSIE 6.0; Windows 98; AT&T WNS5.0; .NET CLR 1.1.4322)"
#redirects and sets test cookie as expected

67.81.102.81 - - [08/May/2003:12:36:39 -0400] "GET
/test/cookie?redirect=https://www.bigfivepros.com/register/professional/
account.htm HTTP/1.1" 302 330
"http://www.bigfivepros.com/professional/index.htm" "Mozilla/4.0
(compatible; MSIE 6.0; Windows 98; AT&T WNS5.0; .NET CLR 1.1.4322)"
#cookie test is ok

67.81.102.81 - - [08/May/2003:12:36:39 -0400] "GET
/register/professional/account.htm HTTP/1.1" 200 19510
"http://www.bigfivepros.com/professional/index.htm" "Mozilla/4.0
(compatible; MSIE 6.0; Windows 98; AT&T WNS5.0; .NET CLR 1.1.4322)"
#initial page is displayed

67.81.102.81 - - [08/May/2003:12:37:51 -0400] "POST
/register/professional/account.htm HTTP/1.1" 302 303
"https://www.bigfivepros.com/register/professional/account.htm"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; AT&T WNS5.0; .NET CLR
1.1.4322)"
#data posted and redirect response as expected

67.81.102.81 - - [08/May/2003:12:37:51 -0400] "GET
/register/professional/contact.htm HTTP/1.1" 302 303
"https://www.bigfivepros.com/register/professional/account.htm"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; AT&T WNS5.0; .NET CLR
1.1.4322)"
#request for page 2redirects back to page 1 because it can't see the
cookie

67.81.102.81 - - [08/May/2003:12:37:51 -0400] "GET
/register/professional/account.htm HTTP/1.1" 200 19510
"https://www.bigfivepros.com/register/professional/account.htm"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; AT&T WNS5.0; .NET CLR
1.1.4322)"
#initial page displayed again

The last few browsers to see the error are all recent Internet Explorer
versions as seen from the log:
Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; H010818)
Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461)
Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; AT&T WNS5.0; .NET CLR
1.1.4322)
Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461)
Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; YComp 5.0.0.0)

The exact same behavior is seen consistently but irregularly.
Irregularly enough to have never been seen on tests carried out on all
recent versions of IE and Netscape prior to going live with the site.
Any ideas about what may be causing this problem, which may not really
be a mod_perl issue? I have even replaced the calls to
Apache::Cookie->bake() with directly setting the error headers myself to
no avail. I realize this may be a little OT but maybe someone could
direct me to a solution.

Thanks,

Michael Koob
MDK & Associates Inc.
michael@michaelkoob.com


Mime
View raw message