RE: [PHP] header function odd behavior
-Original Message- From: H Rao [mailto:hydsd...@gmail.com] Sent: 28 June 2011 04:40 I am trying to understand odd(different) behavior of the header function under two different environments. Here is the code which I am trying to execute from two different servers ? header (Set-Cookie: c1=value1;path=/; domain=.domain.com); header (Set-Cookie: c2=value2;path=/; domain=.domain.com); ? When executed from server1(OS X), both cookies are set in browser, but when executed from server2(Linux), only the second cookie is set. server1 and server2 are running different OS and php version as below. I know I could add $replace=false option on the Linux server, but I am trying to understand the different behavior of header() function on these two servers. Any thoughts? Well, according to the manual, you need to be using the FALSE parameter anyway since By default it will replace, but if you pass in FALSE as the second argument you can force multiple headers. So the wrong behaviour is on the (older) OS X server, but I'm as confused as you as to why this should be as there is no indication in the manual or the ChangeLog that the default behaviour has changed at any point. Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, Portland PD507, City Campus, Portland Way, LEEDS, LS1 3HE, United Kingdom E: m.f...@leedsmet.ac.uk T: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header function odd behavior
Hi, I am trying to understand odd(different) behavior of the header function under two different environments. Here is the code which I am trying to execute from two different servers ? header (Set-Cookie: c1=value1;path=/; domain=.domain.com); header (Set-Cookie: c2=value2;path=/; domain=.domain.com); ? When executed from server1(OS X), both cookies are set in browser, but when executed from server2(Linux), only the second cookie is set. server1 and server2 are running different OS and php version as below. I know I could add $replace=false option on the Linux server, but I am trying to understand the different behavior of header() function on these two servers. Any thoughts? server1 - OS X -- PHP Version 5.2.4 System Darwin host2.domain.com 8.8.4 Darwin Kernel Version 8.8.4: Sun Oct 29 15:26:54 PST 2006; root:xnu-792.16.4.obj~1/RELEASE_I386 i386 -- server2 - Linux -- PHP Version 5.3.5 System Linux host1.domain.com 2.6.18-164.15.1.0.1.el5 #1 SMP Wed Mar 17 01:10:06 EDT 2010 x86_64 -Rao
Re: [PHP] header function odd behavior
On 06/28/2011 09:10 AM, H Rao wrote: Hi, I am trying to understand odd(different) behavior of the header function under two different environments. Here is the code which I am trying to execute from two different servers ? header (Set-Cookie: c1=value1;path=/; domain=.domain.com); header (Set-Cookie: c2=value2;path=/; domain=.domain.com); ? When executed from server1(OS X), both cookies are set in browser, but when executed from server2(Linux), only the second cookie is set. server1 and server2 are running different OS and php version as below. I know I could add $replace=false option on the Linux server, but I am trying to understand the different behavior of header() function on these two servers. Any thoughts? snip I don't have a clear idea about this because I always use setcookie(), but something tells me that this has something to do with output buffering and friends. -- Regards, Nilesh Govindarajan @nileshgr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php