#25870 [Com]: Session variables do NOT work as expected
| From: | sambukkaa at hotmail dot com | Date: | Tue, 02 Mar 2004 19:16:30 +0000 |
| Subject: | #25870 [Com]: Session variables do NOT work as expected | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-55798@lists.php.net to get a copy of this message | ||
ID: 25870
Comment by: sambukkaa at hotmail dot com
Reported By: memoimyself at yahoo dot com dot br
Status: Bogus
Bug Type: Session related
Operating System: Windows 2000 SP 4
PHP Version: 4.3.3
New Comment:
Well, I belive you and I have had many problems with sessions too.
some are saved some are saved but empty and some are never saved.
sessions do what they want and when they want it.
I'm also not a newby and I write critics about programms.
I'm sure that there is buffer over run problem in the sessions code and
it will tack a while till someone would open his eyes.
In the meanwhile do what all others do.
1) use mysql to save your sessions.
2) create and save them as files yourself.
for this you already find a lot of solutions on net.
and now comes the automaticaly copy and paste answer :)
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2003-10-14 20:09:49] sniper@php.net
Works fine for me under Windows. (using Apache 2.0.47 and a working
script). Please don't reopen this, there is no bug here.
------------------------------------------------------------------------
[2003-10-14 18:25:02] memoimyself at yahoo dot com dot br
First of all, thanks a lot for taking time to reply to my post so
quickly.
Now, while I have not taken any offence whatsoever and can only imagine
how busy you must be, I am *not* a newby and have *always* called
start.php before test.php. The session variable ($_SESSION['test'])
simply will *not* be registered unless I *reload* start.php (i.e. load
it twice). On the start.php page I have included a
link to test.php, so that the second page is only called after the
first, i.e. the session variable was *supposed* to have been
initialized.
Perhaps this is a bug only affecting PHP under Windows?
------------------------------------------------------------------------
[2003-10-14 17:57:17] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
Works fine, if start.php which intializes the session variable is
always started before test.php, which uses it.
------------------------------------------------------------------------
[2003-10-14 14:03:48] memoimyself at yahoo dot com dot br
Description:
------------
I read in the manual that the use of session_register() is deprecated
and that session variables should now be registered simply by creating,
and assigning a value to, a member of the $_SESSION array.
Well, try as I may, I just cannot register session variables without
using session_register(). If, however, I use session_register() before
assigning a value to the new session variable via $_SESSION['x'],
everything works fine.
Reproduce code:
---------------
// PAGE A (start.php):
<?php
session_start();
$_SESSION['test'] = 'my test';
?>
/*******/
// PAGE B (test.php, called after start.php, obviously):
<?php
session_start();
print $_SESSION['test'];
?>
Expected result:
----------------
OUTPUT TO SCREEN:
my test
Actual result:
--------------
OUTPUT TO SCREEN:
Notice: Undefined index: test in D:\htdocs\Test\session\test.php on
line 3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25870&edit=1