Link to home
Start Free TrialLog in
Avatar of Manager-pd
Manager-pdFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Problem with PHP header redirect with some browsers

I seems to have a problem with PHP header redirect with some browsers. Mainly using Windows 98 OS and MAC 9 OS some other.

Please see header response from my server on page 1 and 2.

What do I need to change on the server?  Probably in php.ini?

Page 1

User IP Address: 81.139.xx.xxx#1 Server Response: https://secure.myserver
HTTP Status Code: HTTP/1.1 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Set-Cookie: PHPSESSID=pl47kl5i1of25tsoc8e731npe6; expires=Fri, 21-Jul-2006 10:08:14 GMT; path=/
Date: Fri, 21 Jul 2006 09:44:14 GMT
Connection: close

Page 2

User IP Address: 81.139.xx.xxx#1 Server Response: https://secure.myserver/page_2.php
HTTP Status Code: HTTP/1.1 302 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 146
Content-Type: text/html
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Location: bf_donations_step_1.php
Set-Cookie: PHPSESSID=pl47kl5i1of25tsoc8e731npe6; expires=Fri, 21-Jul-2006 10:22:43 GMT; path=/
Date: Fri, 21 Jul 2006 09:58:44 GMT
Connection: close
Avatar of ahoffmann
ahoffmann
Flag of Germany image

> Location: bf_donations_step_1.php
RFC recommends that the Location header uses a full URI including schema and FQDN.
Even most browsers accept relative paths too, you seem to have some being picky or stupid ;-)
Avatar of Manager-pd

ASKER


Hi,
I’ve made the change from relative path to full path for header redirect, but unfortunately it didn’t make any difference.

I  can see how PC  with Windows 98 and MSIE 6.0 browser can display a session ID on the second page, but it can’t get data from server side session file or  MySQL database.


Any thoughts?


 
confused. What has the session ID to do with your question?
Sorry, I am only trying to analyse the situation. If session ID is nothing to do with my question then ignore it.
what's your problem now, after you fixed the Location header?
Same problem with PHP header redirect with some browsers. Mainly using Windows 98 OS. Please see the top of the page.
please post the Location header which causes the problem
I had to move back to relative path again. Please find the header.
-------------------------------------------------------------------------------------------------------
#1 Server Response: https://secure.myserver/bf_donations_step_2.php
HTTP Status Code: HTTP/1.1 302 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 146
Content-Type: text/html
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Location: bf_donations_step_1.php
Set-Cookie: PHPSESSID=b2cetnskmpbma531ac2qn9kdv2; expires=Wed, 26-Jul-2006 15:24:47 GMT; path=/
Date: Wed, 26 Jul 2006 15:00:47 GMT
Connection: close
Redirect Target: bf_donations_step_1.php
The Web Server can use the following Header Fields
Method
HTTP-Version
URI
Date
Connection
Authorization
If-Modified-Since
Content-Length
Content-Type
All other server headers are parsed, but they are ignored.

as I said: relative paths are not RFC-compliant, so don't blame the browser but the programmer of your application
Thanks for the comment. As I already tested with full path and I still haveing the same problem, I don't see relative path as been a problem in my case.
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I appreciate that, but the problem is it’s not my browsers, it’s external users browsers. So I don’t think I can tell them to change there PCs.

What I can’t understand is way some browsers on Windows 98 PC can go from page to page and others can’t. The version of browsers look the same to me when I check web log files.

Is there known issue with Windows 98 in my case?