?
Solved

What is the best way to store/move data in a typical website registration process?

Posted on 2007-10-01
12
Medium Priority
?
182 Views
Last Modified: 2008-01-09
Hi All,

Say I have a 4 page website registration process. I am collecting different kinds of data through each of their pages. What is the best way to store/pass the information from page1 to Page4 before its finally committed to the database?

Is it through hidden fields or through session or cookies etc?

What is the most practical way or a great practice to follow?

PS: I am hoping that this is a platform independent approach. I can code in coldfusion, asp & php
0
Comment
Question by:dynamota
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 1

Author Comment

by:dynamota
ID: 19992358
I am sure there are different ways to skin this. But I am hoping to use a time tested, practical way of doing it.
0
 
LVL 15

Assisted Solution

by:dave4dl
dave4dl earned 400 total points
ID: 19992438
pass the data through form POST storing previous page inputs in hidden fields.  This has the advantage of never timing out and there is no real performance difference between this and session cookies
0
 
LVL 11

Assisted Solution

by:AlexanderR
AlexanderR earned 600 total points
ID: 19992455
I think session is the most practical way.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 15

Expert Comment

by:dave4dl
ID: 19992484
i said "session cookies" but i meant "session variables" (doh).  Depending on how cookies are used they could introduce some degradation in performance (also persistent cookies are not intended to hold temporary data for website operation).
0
 
LVL 15

Expert Comment

by:dave4dl
ID: 19992496
session variable are simple to code but they have the big negative that if the user gets distracted for one reason or another in the middle of the process the session will time out and the user will have to re-enter their info from the first few pages (this happens often).
0
 
LVL 9

Accepted Solution

by:
paradoxengine earned 1000 total points
ID: 19993728
The time tested way is using Sessions, and that's it.
Let the system manage the way sessions are handled (via cookies, url rewrite and whatever).
They may timeout, but are by far the easiest way to go: you don't make your page bigger (as in using hidden post fields) and you take the easy road during the coding stage.
0
 
LVL 15

Expert Comment

by:dave4dl
ID: 19993799
it is definitely easier coding it using session variables but it is the inferior/lazier solution
0
 
LVL 9

Expert Comment

by:paradoxengine
ID: 19994022
I do not agree with you dave4dl.
If the user gets distracted on a long enough timeout (say, 15 minutes) then I think it's not a big issue losing the information, and it will happen on a small percentage of the userbase. On the other hand, if you have a lot of users then you are going to add lots of not needed stuff in your form, meaning longer download and parsing time.
There might be very good reasons not to use sessions (to support cookieless clients, for instance, or because you are expecting your users to be very very slow form-fillers as dave points out, conditions which can both happen in the real world) but as a general rule the "standard" solution is to use sessions.
0
 
LVL 15

Expert Comment

by:dave4dl
ID: 19994446
I dont have any survey data other than my own experience but i have experienced irritating timeouts many times on websites and that very negatively impact my impression of those websites (if you could avoid it completely, even if it is not an issue for everyone, why would you not?)

On the performance end of things the extra download and parse time is on the order of tens or hundreds of milliseconds (depending on your situation) which is inconsequential.  Using the hidden form fields you get the performance BENEFIT of not using memory resources on the server (although for a registration page this will also be inconsequential).

I agree that session variables are the "standard" solution in this case but this is one of those instances where there exists a better way than the standard.  On a side note i am seeing more and more websites these days that are holding their user inputs in hidden fields between pages of multi-page forms (tax websites, experts exchange, online store registration).

The biggest negative to the form approach is the initial coding time and code maintenance time (which is actually a pretty big negative).
0
 
LVL 9

Expert Comment

by:paradoxengine
ID: 19994496
Add to the negative list the  XSS checks, since you are printing out user input. But yes, I admit that the performance argument isn't a strong one.
0
 
LVL 15

Expert Comment

by:dave4dl
ID: 19994573
Since my last post i had another thought.
You could code it in such a way that it would handle adding or removing inputs with no new code to persist the data from page to page.  This could also include generic xss tests.  This somewhat mitigates the maintenance time issue.

Basically what it comes down to is that it depends on your situation.  If you expect people to be using slow dial-up to access your website and you dont want them to wait any longer than they already have to (and your web server wasnt built in this millenium, i.e. it has enough memory) then paradoxEngine has the right answer.  If you dont want people to have to deal with the form timing out and the other considerations are secondary (such as it taking a little longer to code in the first place and possibly longer to make changes to the form in the future) then go with my suggestion of the hidden form fields.
0
 
LVL 1

Author Comment

by:dynamota
ID: 19998325
Hi All,

Thank you so much for sharing your thoughts. You guys even broke it down further which was a big help. I think I will end up going the sessions way. But both cases have merit.

Thank you all once again...
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Suggested Courses
Course of the Month14 days, 12 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question