View Full Version : SESSION and Wizard Form?

01-07-2006, 10:55 PM
I am creating a wizard which is like a multipages form. I have a wizard class and several other classes for the fields. Each time I load the wizard, I use "new" to allocate the wizard. I use $_SESSION to store the field data user enters.

Is there a reason in term of efficiency and memory usage why I don't just save the whole wizard object into the $_SESSION instead of saving individual field data into the $_SESSION? I can just do "$wizard = &$_SESSION['wizard'];" every time I load the wizard after the first page. And I don't think it uses more memory because it's using the same copy of wizard object all the time.

The one thing I think of is if I plan to save session into database because I need to use multiple web server, I will have problem saving the whole wizard object into database. Even if I can, it may take much more space than just the field data.

Many thanks.