> Hmmm, it seems that "obj" is not saved to the session file.
> 
> 
> I don't thik that & before new is needed.

This is weird :) It worked when I removed the & (thought that I tried that 
;). Now I just can't remember why I put it there in the first place. I hope 
it wasn't importent ... well I will proboply find out when some of the code 
dosn't work.


> Also may the problem is in that you use the class contructor. When
> objects are saved in session, and on other page you want to wakeup them
> you must provide two methods for the class: 
>  function __sleep(){
>   return array("r","l","p","m_id");
>  }
>  function __wakeup(){
>     $this->res_id=mysql_connnect("user","pass","host");
>  }
> __sleep()  (double under) is called before wrinting in session file. it
> returns names (as strings) of variables which have to be saved. Why not
> all, because you can have a $res_id of db_link which is meaningless to
> save. __wakeup() is called when the object is restored in memory. If
> you have $res_id you have to create it here, so the persistent object
> after restoring to be as before saving. 

I knew about the __sleep() and __wakeup() but not about the returning of an 
array containing the names of the varibles that needs to be stored. Cool 
feature - Thanks for the tip :)

/watson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to