I'm trying to create a session class so that I can manage the session as an object and I can pass that object around to other class function.
But in my constructor of my session class how to I set the session as my class instance?
Example:
class Session {
var $session;
function __construct($tmp_session) {
$session = $tmp_session;
}
//..... other code and function
?>
Then on the page I've this.....
require 'session.php';
session_start();
$session = new Session($_SESSION);
}
Will that work? I just try it and it seems doesn't work. Any idea?
2007-05-17
09:01:07
·
1 answers
·
asked by
Michael C
1
in
Computers & Internet
➔ Programming & Design