Re: Passing object reference to session

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Moyle schreef:
Hi,

I am new to the list and have a question that inspired me to join the
list as I can not find any answer online.

When a object reference is passed to the $_SESSION array what happens to

let's assume php5. all objects are reference like, they behave from a user POV
as objects would in php4 if you passed them by reference explicitly.

that said they're not really references - there is a Sara Golemon article which
explains it ... not that I truely understand the inner machinations of the engine.

the object? Is the object serialized and saved in session (in this case
file)? Or just the reference with the object in memory remaining on the
heap?

php is 'share nothing' architecture ... everything disappears at the end of a
request - nothing remains in memory.

an object stored in $_SESSION will be automatically serialized and saved where ever
the session data is saved (usually to disk).

the only thing to remember is that you must have the class of the object stored in
$_SESSION loaded *before* you restart the session otherwise php will generate an
object of class stdClass.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux