Solved

Problem with PHP header redirect with some browsers

Posted on 2006-07-21
14
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
14 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17157105
> 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
ID: 17168153

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
ID: 17168230
confused. What has the session ID to do with your question?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:Manager-pd
ID: 17175987
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
ID: 17176325
what's your problem now, after you fixed the Location header?
0
 

Author Comment

by:Manager-pd
ID: 17183489
Same problem with PHP header redirect with some browsers. Mainly using Windows 98 OS. Please see the top of the page.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17184047
please post the Location header which causes the problem
0
 

Author Comment

by:Manager-pd
ID: 17184917
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
ID: 17185112
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
ID: 17191387
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
ID: 17191907
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
ID: 17199748
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

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

734 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