Sessions and Internet Explorer

From: Date: Mon, 11 Sep 2000 19:07:28 +0000
Subject: Sessions and Internet Explorer
Groups: php.general 
Request: Send a blank email to php-general+get-16210@lists.php.net to get a copy of this message
Version: php-4.0.1pl2 Compiled with: --enable-trans-sid Here are a few notes for using sessions with Internet Explorer 5.5. If you see some errors with my logic please let me know. I don't subscribe to the list so if you could send responses to dan@spinweb.net that would be great. 1. IE doesn't accept the location header string correctly. Luckily the fix doesn't harm Netscape. You have to send a line break after the URL: header ("Location: http://hostname.net/script.php?".SID."\n"); 2. The first time the PHPSESSID cookie gets set, IE produces an error. Specifically, I had a form that used a POST method. After the form was submitted, to a page that started a session, it gave me some generic IE ["cosmetically pleasing"] error. If I hit the back button in my browser and resubmit the form it works and every time after that it seems to work. I fixed the problem by explicity passing the SID via GET string: session_start(); if(!$PHPSESSID) { header ("Location: http://hostname.net/script.php?".SID."\n"); exit; } Have a good day, DS -- Dannie M Stanley SpinWeb Net Designs, Inc. http://www.spinweb.net

« previous php.general (#16210) next »