On Mon, 9 Dec 2002, Perrin Harkins wrote:

> md wrote:
> > My question is with regards to whether I need or
> > should put the submitted data into the session as the
> > user navigates the forms (to create an account). The
> > user will be taken through three forms to create an
> > account. So for instance, form one will ask the user
> > to create a username, password, and provide an email
> > address. Before moving on to form two (billing info),
> > should I put this data in the session, or just go
> > ahead and dump it in the database (after making any
> > nec. checks), since I won't need the info until they
> > actually login? Or should I collect all the info from
> > all three screens by putting it in the session as the
> > user traverses the forms and then put it all in the
> > database at once? I'm currently using the first
> > option. BTW, it is possible for a user to create a
> > free account by hitting form one only, so no harm
> > would come if something happened after form one.
>
> This is really a question of requirements.  In systems where all

Agreed.
I have a golden rule for this:

if (( management are annoying and like to know about incomplete
      registrations
      ||
      you want one point of varifying input so that designers can
      shove in as many intermediary pages as possible)
     )
    &&
        You don't have a ridiculous amount of fields to process )
        {
        place in session
        }
else
      {
      shove in hiddens.
      }

I wouldn't start populating your real tables until the registration is
complete since you may end up with lots of incomplete junk in there and
your form design will be governed by any database constraints placed on
your table (foreign keys, and stuff).

Then again, I sometimes have to bend my golden rules.  Fortunately Perl
and Gold both bend easily.

> usually don't store form input in the session because it leads to
> strange results if the user has multiple browser windows open on the
> site, but that may not be an issue for your application.

I'm not sure how often a user will attempt to complete one form through
multiple browsers.  To be honest I'm not sure that he/she should.  I think
of a form as one process which may remain persistant due to hiddens or a
session.  Once the form has been completed or a user has logged in, the
session data used for the rest of the site should probably be unrelated
and populated separately.

That's just my 0.02 EU on a cold Monday evening.

R.


Reply via email to