RE: [PHP] Session files in /tmp are zero length
| From: | James E Hicks III | Date: | Wed, 14 May 2003 19:29:48 +0000 |
| Subject: | RE: [PHP] Session files in /tmp are zero length | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147644@lists.php.net to get a copy of this message | ||
>>>>>$test='foobar';
>>>>>session_register('test');
reverse these two lines in your test script.
register the variable first, then assign a value to it.
session_register('test');
$test='foobar';
Jame Hicks
-----Original Message-----
From: Lee Stewart [mailto:lstewart@dsgroup.com]
Sent: Wednesday, May 14, 2003 3:24 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Session files in /tmp are zero length
Sorry, no errors mentioning php anything anywhere... No .htaccess
either And I had to turn on register_globals in php.ini to get it to
read the web forms the way it's coded. Since turning that on now gets
data from the web form, I know it's working...
And yes, cookies are enabled, but I'm not telling it to create cookies,
just the session data...
The more I look around, the more I can't help but wonder since it worked
on 4.0.3 and now fails on 4.2.2, and even your simple example fails, it
must be either something in PHP that's broken, or something in the PHP
setup... Yes?
Lee
Kirk Johnson wrote:
> Do you have cookies enabled in your browser? If not, then two session files
> would have been created in the 2-page test below, one with 18 bytes, one
> with 0 bytes.
>
>
>>>>Thanks for the suggestion... Trying your simple test,
>>>
>>page2 comes up
>>
>>>>with "test is". And I get another new sess_... file in
>>>
>>/tmp, also zero
>>
>>>>bytes....
>>>>
>>>>Lee
>>>>
>>>>Kirk Johnson wrote:
>>>>
>>>>>Sorry, I am stumped. I would start out with the simplest test
>>>>
>>>>page I could
>>>>
>>>>>make, and see if you can get that to work:
>>>>>
>>>>>page.php
>>>>><?
>>>>>session_start();
>>>>>$test='foobar';
>>>>>session_register('test');
>>>>>header('Location: page2.php');
>>>>>?>
>>>>>
>>>>>page2.php
>>>>><?
>>>>>session_start();
>>>>>echo "test is $test<br>";
>>>>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php