How To Set Session/Cookie

Permalink
Hello All-

I'm creating a multi-page form (5 steps) using single pages + controllers for single page.

What I need to do is pass the information from the form in step 1 to step 2 etc...

What would be the best way to do this? $_SESSION, $_COOKIE, or insert into db every step of the way?

Can someone give an example of taking $this->post array in the step1 controller and getting it into a variable I can use in the step2 controller?

Thank You!!!

 
ScottC replied on at Permalink Reply
ScottC
I'd do db.
It isn't a ton of work, i'd probably just serialize it into json and pull it back out on subsequent requests. You'd still want to associate the record with a session generated key so you can look it up between page visits.

The reason why I would put it in the database is if your company wants to you can look through the steps and see where you are losing people, if you aren't logging this in some way then you'd have no way of knowing aside from google analytics.
leesalminen replied on at Permalink Reply
Hey Scott-

You were right :). I ended up doing serialized POSTs into the same table with ajax and just identified by a stepID and the sessionID.

Pretty sweet.

Thanks for the help.

Lee