$PHPSESSID blank on initial php file

This is a discussion on $PHPSESSID blank on initial php file within the PHP Language forums, part of the PHP Programming Forums category; Hi, When I initially start my browser (any of 'm) and point it to my PHP script the $PHPSESSID is ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-13-2003
JohnS
 
Posts: n/a
Default $PHPSESSID blank on initial php file

Hi,

When I initially start my browser (any of 'm) and point it to my PHP script
the $PHPSESSID is always blank.
On all subsequent hits or after a refresh the value for $PHPSESSID is
fine... why do I have to complete a php file before the $PHPSESSID is set?
I tried to do session_start() before anything still blank, what did I
miss?
(Aix 4.3.3, php 4.2.1,Apache 1.13.26)

Thanks!

John.


Reply With Quote
  #2 (permalink)  
Old 08-13-2003
JohnS
 
Posts: n/a
Default Re: $PHPSESSID blank on initial php file

Ok ok, I'm reading the "Fantastic" manual right now....again...

J.

btw. I did before...no answer yet... any more hints?


"Ian.H [dS]" <ian@WINDOZEdigiserv.net> wrote in message
news:20030813215128.2a35a071.ian@WINDOZEdigiserv.n et...
> On Wed, 13 Aug 2003 20:26:57 GMT in
> <message-id:lax_a.1452$zS4.27079748@newssvr13.news.prodigy. com>
> "JohnS" <PleaseNoSpam@myaccount.com> wrote:
>
> > Hi,
> >
> > When I initially start my browser (any of 'm) and point it to my PHP
> > script the $PHPSESSID is always blank.
> > On all subsequent hits or after a refresh the value for $PHPSESSID is
> > fine... why do I have to complete a php file before the $PHPSESSID is
> > set? I tried to do session_start() before anything still blank,
> > what did I miss?
> > (Aix 4.3.3, php 4.2.1,Apache 1.13.26)

> ^^^^^^^^^
>
>
> The reason you haven't RTFM is?
>
> By default, of course $PHPSESSID will be blank.. as to why, is a task
> you're left to read about, but as a hint.... http://php.net/ ;)
>
>
>
> Regards,
>
> Ian
>
> --
> Ian.H [Design & Development]
> digiServ Network - Web solutions
> www.digiserv.net | irc.digiserv.net | forum.digiserv.net
> Programming, Web design, development & hosting.



Reply With Quote
  #3 (permalink)  
Old 08-13-2003
JohnS
 
Posts: n/a
Default Re: $PHPSESSID blank on initial php file

Is it that the *browser* generates the $PHPSESSID not PHP? And therefore
must at least load 1 php file before it can do so? I was thinking it was
generated by PHP as in *PHP*sessid....

right?

Just nod if you agree Ian....

Thanks!

John.


"Ian.H [dS]" <ian@WINDOZEdigiserv.net> wrote in message
news:20030813215128.2a35a071.ian@WINDOZEdigiserv.n et...
> On Wed, 13 Aug 2003 20:26:57 GMT in
> <message-id:lax_a.1452$zS4.27079748@newssvr13.news.prodigy. com>
> "JohnS" <PleaseNoSpam@myaccount.com> wrote:
>
> > Hi,
> >
> > When I initially start my browser (any of 'm) and point it to my PHP
> > script the $PHPSESSID is always blank.
> > On all subsequent hits or after a refresh the value for $PHPSESSID is
> > fine... why do I have to complete a php file before the $PHPSESSID is
> > set? I tried to do session_start() before anything still blank,
> > what did I miss?
> > (Aix 4.3.3, php 4.2.1,Apache 1.13.26)

> ^^^^^^^^^
>
>
> The reason you haven't RTFM is?
>
> By default, of course $PHPSESSID will be blank.. as to why, is a task
> you're left to read about, but as a hint.... http://php.net/ ;)
>
>
>
> Regards,
>
> Ian
>
> --
> Ian.H [Design & Development]
> digiServ Network - Web solutions
> www.digiserv.net | irc.digiserv.net | forum.digiserv.net
> Programming, Web design, development & hosting.



Reply With Quote
  #4 (permalink)  
Old 08-13-2003
Terry Austin
 
Posts: n/a
Default Re: $PHPSESSID blank on initial php file

"JohnS" <PleaseNoSpam@myaccount.com> wrote in
news:wEx_a.1397$tv1.1180@newssvr27.news.prodigy.co m:

> Ok ok, I'm reading the "Fantastic" manual right now....again...
>
> J.
>
> btw. I did before...no answer yet... any more hints?


Session ID is returned from the browser. The browser doesn't have it until
after it loads the first page of the session. This behavior is by intent.

Is there a way to retrieve a cookie you just set?

--
Larry Flynt for Governor
Bringing dignity back to the Governor's Mansion

Terry Austin
taustin@hyperbooks.com
Reply With Quote
  #5 (permalink)  
Old 08-13-2003
JohnS
 
Posts: n/a
Default Re: $PHPSESSID blank on initial php file

> Well, John.. seeing as you're using PHP 4.2.1, have you checked your
> register_globals settings in php.ini? oh, of course you have! you read
> the very FINE manual properly didn't you? =)


Indeed, I did...but not all of it...


> Funny how php.net has this screaming out at you, and has done for
> absolutely ages.. why oh why are people _still_ shocked when their
> poorly written scripts fail (and yes, your method is _VERY_ poor and
> insecure).


One day... when I am just as good as you...

Thanks for your help.
Cheers,
J.


Reply With Quote
  #6 (permalink)  
Old 08-14-2003
JohnS
 
Posts: n/a
Default Re: $PHPSESSID blank on initial php file

Ian:

Very good point!

Let me investigate further and modify my scripts. First I am going to Read
The Fantastic Manual once more...

Cheers,
John.

> John, it's not that at all.. apologies for the harshness.

No apologies needed.

> No probs.. am I to assume it was the globals issue? (just curious now

=) ).
I had register_globals on, but now I am going to turn them off, and redo
some scripts. Better save than sHacked.

J.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:51 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0