note 58157 rejected from function.session-start by jome
| From: | jome@php.net | Date: | Wed, 26 Oct 2005 05:14:02 +0000 |
| Subject: | note 58157 rejected from function.session-start by jome | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-97607@lists.php.net to get a copy of this message | ||
Note Submitter: jlh at gmx dot ch
----
I've not yet found out how to do the following: When a suitable session for the user exists,
then it shall be loaded. If no session exists, then *no session shall be created*.
session_start() will create a new session if none exists, so the only solution is to call this
function conditionally. But how to check whether a suitable session exists on the server? I could
check for the presence of a cookie with the SID, but that doesn't imply that the session really
exists on the server. session_id() doesn't return anything useful as long as session_start()
hasn't been called, so it's of no use. Anyone got a clue?
Of course, I can find other alternatives for my real life code; they are a little bit suboptimal,
but still more than acceptable. I'm asking this out of curiosity, because I want to know if
there's a clean way to do it.