At 08:22 26.02.2003, Bryan Lipscy said:
--------------------[snip]--------------------
>I ran into a weird curiosity playing with sessions.
>
>Consider this working code:
><? 
>       session_start();
>       echo "Session ID == ".SID;
>?>
--------------------[snip]-------------------- 

The SID constant contains the session identifier that is to be added to a
link, IF NECESSARY.

This said: PHP normally uses cookies to transfer the session ID to the
client browser (controlled by the ini file setting "session.use_cookies").
If the client browser returns a session cookie there's no need for PHP to
rewrite the URL links, thus SID is empty. If the client browser does NOT
return a session cookie, SID contains the necessary information for URL
rewriting.

If you need to generate the SID value regardless of cookie/non-cookie
settings, use
    $sid = session_name() . '=' . session_id();

All this can be found at http://www.php.net/manual/en/ref.session.php and
the following pages.


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to