I tried recently to insert an class object as a session var,
not realy sure about the result.
1. It works
2. It doesn't save the methods, just the object vars
3. all you have to do is include the class before starting the session
As this sounds too easy, I was wondering where's the trick.
Does anyone know a downside to this ?
not realy sure about the result.
1. It works

2. It doesn't save the methods, just the object vars

3. all you have to do is include the class before starting the session

PHP Code:
<?
include('class_user.php');
session_start();
if(!isset($_SESSION['user'])){
$_SESSION['user'] = new User;
}
$user = &$_SESSION['user'];
... your page ....
?>
Does anyone know a downside to this ?
Comment