Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with PHP header redirect with some browsers

Posted on 2006-07-21
14
Medium Priority
?
235 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
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 

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 2000 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

730 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