Solved

Problem with PHP header redirect with some browsers

Posted on 2006-07-21
14
225 Views
Last Modified: 2010-04-20
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
0
Comment
Question by:Manager-pd
  • 6
  • 6
14 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> 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 ;-)
0
 

Author Comment

by:Manager-pd
Comment Utility

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?


 
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
confused. What has the session ID to do with your question?
0
 

Author Comment

by:Manager-pd
Comment Utility
Sorry, I am only trying to analyse the situation. If session ID is nothing to do with my question then ignore it.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
what's your problem now, after you fixed the Location header?
0
 

Author Comment

by:Manager-pd
Comment Utility
Same problem with PHP header redirect with some browsers. Mainly using Windows 98 OS. Please see the top of the page.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
please post the Location header which causes the problem
0
 

Author Comment

by:Manager-pd
Comment Utility
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.

0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
as I said: relative paths are not RFC-compliant, so don't blame the browser but the programmer of your application
0
 

Author Comment

by:Manager-pd
Comment Utility
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.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
Comment Utility
so you tell us that you have browsers that cannot handle Location headers?
I guess the only way to fix this is to use a reliable browser.
0
 

Author Comment

by:Manager-pd
Comment Utility
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?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now