Bug #12704: Session variables DO NOT WORK!
| From: | mikepc143 at home dot com | Date: | Sun, 12 Aug 2001 05:36:57 +0000 |
| Subject: | Bug #12704: Session variables DO NOT WORK! | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-62966@lists.php.net to get a copy of this message | ||
From: mikepc143@home.com
Operating system: Windows 2000, Service Pack 2
PHP version: 4.0.6
PHP Bug Type: Session related
Bug description: Session variables DO NOT WORK!
/* class.user.php included from required file classes.php */
// class definition is as follows:
class User
{
var $username;
var $userid;
var $email;
var $logged_in;
var $on_from;
var $goto;
var $time_on;
var $msglock;
function set_email($s)
{
$this->email = $s;
}
function get_email()
{
return $this->email;
}
function set_username($s)
{
$this-> username = $s;
}
function log_in($id,$u, $mip, $timeclock, $pri=1)
{
$this-> on_from = $mip;
$this-> time_on = $timeclock;
$this-> username = $u;
$this-> guildid = $pri;
$this-> userid = $id;
$this-> logged_in = true;
}
}
class Site {};
$SITE = new Site;
$SITE-> wwwroot = "www.gamebaz.com";
$SITE-> droot = "D:/gamebaz/gm/";
$SITE-> libdir = $SITE-> droot . "lib";
require("$SITE->libdir/stdlib.php");
require("$SITE->libdir/dblib.php");
require("$SITE->libdir/classes.php");
require("$SITE->libdir/main_logic.php");
require("$SITE->libdir/form_validation.php");
require("$SITE->libdir/error.php");
if(!isset($this_user))
/*
This code runs half the time, and the other times it doesn't I haven't been
able to narrow it down
I changed nothing in the include files, just all the sudden
it thinks that $this_user is never registered again.
*/
{
@session_start();
global $this_user;
$this_user = new
User("","","","","","","","");
@session_register("this_user");
printf("Starting new user<br>");
}
--
Edit bug report at: http://bugs.php.net/?id=12704&edit=1