Re: Re: YA Session Problem
| From: | Richard Lynch | Date: | Fri, 03 Aug 2001 21:07:30 +0000 |
| Subject: | Re: Re: YA Session Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61179@lists.php.net to get a copy of this message | ||
> > That should be Location with a capital 'L'. It matters.
>
> I have probably 400+ scripts under my belt. I would say a good 150 of
those
> pages use header("location: ..") without it being capitalized. They work
> perfectly fine. What is the difference?
The spec says 'L'.
The spec says case-significant.
*SOME* browsers will not do the right thing.
> I can't start the session for the first time and register a variable?
Isn't
> that what most people do?
Sure you can. But you can't *REDIRECT* in the same page and have it work on
more than half the browsers.
The browser either sees the Cookie first, or the Location first.
Half the browsers do it in one order, half in the other order.
Whichever half sees the Location before the Cookie, that browser will loop
over and over doing the Location and never exectute the Cookie.
> IE 5 for the Mac:
> When I hit ths page first (real page at:
http://www.fromthduke.com/session/)
> the echo of $PHPSESSID does not show up; it's not echoed to the screen.
>
> The echo of var 1 and var 2 work fine. Then the form, of course is there.
>
> So, if $PHPSESSID isn't there, that leads me to believe that the cookie
was
> not set. So, I go check (making sure that before this test the cookie was
> not present before.) Low and behold, the cookie is there in my cookies
list
> and it's got a value.
Hmmmm. Not sure how/when $PHPSESSID gets set by PHP exactly. Normally, a
Cookie being sent and the variable being set are two different actions.
When a Cookie is sent to the Browser, that does *NOT* set the variable --
The *NEXT* page view, the browser sends back the Cookie, and the variable is
set.
Instead of using $PHPSESSID, use the other built-in functions/constants to
see if those are set by the session_start() function.
Still... You are correct that all three variables should be in the session,
regardless of when the Cookie/$PHPSESSID var gets set, I think.
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm