This is a discussion on Custom 404 causes problems with cookie within the Apache Web Server forums, part of the Web Server and Related Forums category; In httpd.conf I added ErrorDocument 404 /404/index.php between the <Directory /> and </Directory> tags. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
In httpd.conf I added ErrorDocument 404 /404/index.php between the
<Directory /> and </Directory> tags. In the body I set a cookie called ABC as follows. // Set the ABC cookie, the value determines where the user's browser is directed after // logging in. if ( $_SERVER['QUERY_STRING'] <> "" ) { $strGLOBAL_QSAddOn = "?" . $_SERVER['QUERY_STRING']; } else { $strGLOBAL_QSAddOn = ""; } $strGLOBAL_CurrentURL = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . $strGLOBAL_QSAddOn; header("set-cookie: DOC=" . $strGLOBAL_CurrentURL . "; path=/; domain=.utexas.edu"); Before I added the custom 404 the system worked fine. ABC contained a string representing the current URL. Now it seems that the cookie is being set twice. Before the page loads the browser attempts to set the cookie with the correct URL. After the page loads it attempts to set the same cookie with http://invalid.com/404/index.php. If I remove the ErrorDocument line (see above), it works as intended. Anyone know why this would happen? -- gorf |
|
|||
|
"gorf" <ask@invalid.com> wrote in message
news:bu6bcg$j7k$1@geraldo.cc.utexas.edu... > In httpd.conf I added ErrorDocument 404 /404/index.php between the > <Directory /> and </Directory> tags. NM, seems that even if a file exists, if it references anything that doesn't exist (even a spacer image with a typo in the file name) the status changes to 404 and the header is re-written. At least that's my guess. Anyway, I fixed that one img tag and now the cookie is only set once. -- gorf |