Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Custom 404 causes problems with cookie

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Related Topics:
Tomcat session cookie configuration - Hello, I want to use Tomcat 5 into the following : Apache 2 (host Tomcat 5 (host B) Apache 2 has rewrite rules : Client URL : (host A) Real URL : ..

Custom Error Pages - Hi All, I am using Apache 2.0.43 / Tomcat 4.1.12 / mod_jk2 , and having no success with using a custom Apache error page (local redirect) or even making plain text For example, in the Apache file httpd: 404 ..

referring page in custom 404 - As part of my 404, I want to offer a link back to the referring page. Doing this makes no sense if there wasn't one. I have: = --> You appear to have typed this URL --> Or maybe..

Custom Error Pages - Hi all Trying to create custom error pages, pages are displayed when errors occur but images are not displayed In my cfg file I have 403 404 I have an error folder in the root of each vhost..

Custom error CODES - Hi there, following We use custom error codes like to report special errors in a Java web We use Apache 1.3 together with the Websphere Server 4 from IBM which handles all the requests for dynamic content. If..
Next:  Apache: configuration httpd.conf  
Author Message
ask2

External


Since: Dec 02, 2003
Posts: 6



(Msg. 1) Posted: Thu Jan 15, 2004 12:27 pm
Post subject: Custom 404 causes problems with cookie
Archived from groups: alt>apache>configuration (more info?)

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

 >> Stay informed about: Custom 404 causes problems with cookie 
Back to top
Login to vote
ask2

External


Since: Dec 02, 2003
Posts: 6



(Msg. 2) Posted: Thu Jan 15, 2004 1:52 pm
Post subject: Re: Custom 404 causes problems with cookie [MORE INFO] [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"gorf" <ask.RemoveThis@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<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Custom 404 causes problems with cookie 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]