Re: [PHP] objects stored in sessions



So, if I create a user object, set the properties of said user object and store that object in the user session will that object be available throughout the application from the session?

Yes. Just remember to include the class definition before you start the session on subsequent pages, otherwise you will encounter problems. Or alternatively use __autoload() to allow the class code to be loaded when you start the session.

--
Richard Heyes
Employ me:
http://www.phpguru.org/cv
.



Relevant Pages

  • Re: VFP Objects for a beginner - help!
    ... Using your "Hello World" as an example, you'd start with a class definition ... Define Class myTextFileMaker As Session ... some of these paramterized functions in to objects that I can use ... VB .net programmer can drop in his app. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: [PHP] clases en sesiones
    ... another server with session.auto_start=On, and I have this problem with the ... Please ensure that the class definition ... session was started in on line 43 ... you might try using a .htaccess to override the default php.ini setting ...
    (php.general)
  • Re: [PHP] object persistence within a session
    ... I am new to PHP but have 40 years experience programming. ... My initial effort includes a class definition which needs to persist for the duration of a WWW session. ...
    (php.general)
  • Re: [PHP] objects stored in sessions
    ... and store that object in the user session will that object be available throughout the application from the session? ... Just remember to include the class definition before you start the session on subsequent pages, ...
    (php.general)
  • Re: Storing a datatable (or arraylist )on ASP.NET Session
    ... Perhaps your ArrayList store smth which can't be casted to object. ... If exactly that code u shown didn't work (emply arraylists) that I recomment to re-register asp.net 2.0 calling aspnet_regiis,exe - i ... Team blog: http://devkids.blogspot.com/ ... b> session variables is stored on web server's local sql database. ...
    (microsoft.public.dotnet.framework.aspnet)