Hey guys,
My brains asleep and I don't know what's wrong with my session class.
I'm over riding session with sesstion_set_sa ve_handler() in a class;
When in my member functions (open, close, read) I use "$this" I get the error "Using $this when not in object context".
Here's my constructor:
[PHP]
/**
* @desc Constructor
*/
function __construct
(
)
{
session_set_sav e_handler(array (&$this, 'open'),
array(&$this, 'close'),
array(&$this, 'read'),
array(&$this, 'write'),
array(&$this, 'destroy'),
array(&$this, 'gc'));
try
{
$this->sessionVO = new SessionVO();
$this->sessionDAO = new DAO($this->sessionVO);
$this->maxLifeTime = get_cfg_var("se ssion.gc_maxlif etime"); // or set it to something else.
}
catch (Exception $e)
{
die($e->getMessage() );
}
}
[/PHP]
here's my open method
[PHP]
/**
* @desc Opens the session
* @return bool
*/
public static function open
(
)
{
$dbLink = $this->sessionDAO->getDBLink();
return !is_null($dbLin k);
}
[/PHP]
My data members are private ($sessionVO and $sessionDAO)
pbmods...ronver donk...anybody? Any suggestion is appreciated.
Yours,
Dan
My brains asleep and I don't know what's wrong with my session class.
I'm over riding session with sesstion_set_sa ve_handler() in a class;
When in my member functions (open, close, read) I use "$this" I get the error "Using $this when not in object context".
Here's my constructor:
[PHP]
/**
* @desc Constructor
*/
function __construct
(
)
{
session_set_sav e_handler(array (&$this, 'open'),
array(&$this, 'close'),
array(&$this, 'read'),
array(&$this, 'write'),
array(&$this, 'destroy'),
array(&$this, 'gc'));
try
{
$this->sessionVO = new SessionVO();
$this->sessionDAO = new DAO($this->sessionVO);
$this->maxLifeTime = get_cfg_var("se ssion.gc_maxlif etime"); // or set it to something else.
}
catch (Exception $e)
{
die($e->getMessage() );
}
}
[/PHP]
here's my open method
[PHP]
/**
* @desc Opens the session
* @return bool
*/
public static function open
(
)
{
$dbLink = $this->sessionDAO->getDBLink();
return !is_null($dbLin k);
}
[/PHP]
My data members are private ($sessionVO and $sessionDAO)
pbmods...ronver donk...anybody? Any suggestion is appreciated.
Yours,
Dan
Comment