RE: [PHP] session data missing
| From: | Ford, Mike [LSS] | Date: | Wed, 09 Jul 2003 10:09:55 +0000 |
| Subject: | RE: [PHP] session data missing | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-154513@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: ulf sundin [mailto:majikthse@spray.se]
> Sent: 09 July 2003 01:01
>
> After creating a new session with session_start() and
> inserting a few values
> e.g $HTTP_SESSION_VARS['foo'] = 'bar'; a file
> /tmp/sess_{session_id} is
> created.
> The problem is that this file is empty! 0 bytes. no data is stored.
> I'm using php 4.0.6 on linux with apache 1.3 something.
Just doing session_start() will create the file. Are you also
session_register()-ing your session vars? The $HTTP_SESSION_VARS array
isn't like the $_SESSION array introduced in PHP 4.1 -- it's values are not
automatically registered. You still have to use session_register(), thus:
session_start();
session_register('foo');
$HTTP_SESSION_VARS['foo'] = 'bar';
HTH
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211