Am Die, 2003-09-09 um 10.19 schrieb micro brew: > Hi everyone, > > I've been experimenting with sessions. I can make > them work just fine in a normal PHP page. But when I > create a class and try to define a session variable > within a method in the class it won't work. I've > tried setting the session variable directly > ($_SESSION['name']='somevalue') but that didn't work. > The normal way of setting it - > session_start(); > session_register('name'); > $name='somevalue'; > > - didn't work either (within the class). > > Am I just missing something obvious? Any suggestions?
You have to include the class-definition _before_ you start the session. Read about it in the manual: http://www.php.net/manual/en/language.oop.serialization.php Hope that helps. -- Marco > TIA. > > Mike > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php