![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I need some advice. I have a form that has data from 4 different tables and about 10 values to save and keep until the form is finally sent. Where would you save the 10 values (all strings or integers, of course)? Session? Cookie? Pass them around as parameter? |
|
I'm a bit confused and would highly appreciate any suggestions. Thanks! |
#3
| |||
| |||
|
|
If it's only one request cycle, there's no real need to save temp data. What are you trying to do? That's exactly my problem, otherwise I would be using variables. It's |
#4
| |||
| |||
|
|
That's exactly my problem, otherwise I would be using variables. It's many request cycles going back and forth that's why I need a proper way to save some data. I'm doing it by passing parameters but it's confusing and I don't like parameter when handling so many variables. |
#5
| |||
| |||
|
|
Is there any chance your form data needs to persist across sessions, (as in user leaves, comes back, resumes filling in unfinished form)? If not, you could save your variables in a hash in session. Otherwise I would create a Form model and save it to the DB. No, user doesn't leave. It just could end up in many request cycles. |
#6
| |||
| |||
|
|
No, user doesn't leave. It just could end up in many request cycles. Didn't have the Session a very small amount of data it can save? |
#7
| |||
| |||
|
|
Marnen Laibow-Koser wrote: If it's only one request cycle, there's no real need to save temp data. What are you trying to do? That's exactly my problem, otherwise I would be using variables. It's many request cycles going back and forth that's why I need a proper way to save some data. I'm doing it by passing parameters but it's confusing and I don't like parameter when handling so many variables. |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
Well, most of it is actullay not any data that's going to be saved in the database. I need to know various numbers like "current number of users", "maximum number of users", "ids of the users" and stuff like that. So I guess I should go for the session? |
#10
| |||
| |||
|
|
Well, most of it is actullay not any data that's going to be saved in the database. I need to know various numbers like "current number of users", "maximum number of users", "ids of the users" and stuff like that. So I guess I should go for the session? What do you mean by "current number of users"? Do you mean how many users are logged on? I got the impression in your original post that we were talking about data entered by the user. How do you know how many users are currently logged on? Remember that a session is on a user by user basis. If you want to remember data across users I think you will have to put it in the db. |
![]() |
| Thread Tools | |
| Display Modes | |
| |