Re: Where is SID?
From: Dave Patton (spam_at_trap.invalid)
Date: 02/22/05
- Next message: Marco: "A newbie question on array"
- Previous message: Ehtor: "Re: FORM METHOD=post ACTION='*.php' only sends empty spaces to mysql ?"
- In reply to: Michael Satterwhite: "Where is SID?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 22 Feb 2005 16:57:56 GMT
Michael Satterwhite <michael.XREMOVETHIS@weblore.com> wrote in
news:02xSd.29075$cW2.7823@fe2.texas.rr.com:
> OK, I'll admit I've been doing it wrong (using session_register()), so
> I'm trying to correct my ways, but...
>
> My script starts with
><?php
> session_start();
> ?>
>
> In the body of my page a link as follows:
>
> Target text
>
> Problem: SID is an empty string. I even tried
> echo "SID: " . SID . '<br />';
>
> and SID echoes as an empty string. Why?
Because you have cookies enabled, and are accepting
a cookie from your domain with the PHP page, and using
a browser that supports cookies ;-)
Do yourself a favour and use the Firefox browser, and
get the LiveHTTPHeaders extension. You can then see
the 'HTTP conversation' between your browser and the
server, and you'll see the session cookie being set,
and returned.
http://www.php.net/manual/en/ref.session.php
Predefined Constants
--------------------
SID (string)
Constant containing either the session name and session ID in
the form of "name=ID" or empty string if session ID was set in
an appropriate session cookie.
Passing the Session ID
----------------------
Alternatively, you can use the constant SID which is always defined.
If the client did not send an appropriate session cookie, it has the
form session_name=session_id. Otherwise, it expands to an empty string.
Thus, you can embed it unconditionally into URLs.
-- Dave Patton Canadian Coordinator, Degree Confluence Project http://www.confluence.org/ My website: http://members.shaw.ca/davepatton/
- Next message: Marco: "A newbie question on array"
- Previous message: Ehtor: "Re: FORM METHOD=post ACTION='*.php' only sends empty spaces to mysql ?"
- In reply to: Michael Satterwhite: "Where is SID?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|