Nazia,
I really like using session-level variables for this type of thing. Try it like this
-
if session("user") = "" then
-
'this is a new user, so clear out the saved db entry
-
session("user") = "user" 'this could be a login name or whatever.
-
end if
-
This would work fine. As long as the person doesn't stay idle for 25 minutes (I'm not sure what the default session time-out is) the db stays good, but if a new person logs in the previous db entry is deleted.
The problem with this method is that if there were two users at the same time they would be cancelling each other's orders.
I think it would work a little better if you stored the selected items in session-level variables:
-
for each x in request.form
-
session(x) = session(x) & request.form(x)
-
next
-
then every time the form is filled out the info is saved in variables that only that user can access. Then you don't have to worry about clearing the db when the user leaves at all because the data is saved temporarily.
Does this make sense?
Jared