|
|
Posted by Rik Wasmus on 11/19/07 19:38
On Mon, 19 Nov 2007 20:25:25 +0100, Matthew <matthew@spamkiller.com> wrote:
> My server runs PHP version 4.4.3.
>
> I'm successfully creating a session and can set and retrieve my own
> session variables.
OK
> As far as I can tell the $_SESSION['uid'] variable should be created
> automatically when session_start() is called. When I retrieve this
> variable however it is empty.
Nope. Unless you name it that way.
<http://nl2.php.net/manual/en/ref.session.php>
The default 'session.name' is PHPSESSID, which you can normally will NOT
find in $_SESSION, but in one of the $_REQUEST arrays (and thus obviously
in $_REQUEST). $_COOKIE['PHPSESSID'] _if_ the session works with cookies,
optionally in the $_POST or $_GET array in case of a transparant session
id (which is not recommandable).
If you choose another name for a session, this should be done with
session_name('custom_name_of_session') BEFORE the call to session_start():
<http://nl2.php.net/manual/en/function.session-name.php>
--
Rik Wasmus
Navigation:
[Reply to this message]
|