Actually you are correct…
Let me see if I can expand what this actually is…
This “app” is used to gather new client information and populate a db. The network is in 3 tiers since this is web based it is on the top tier.
Due to the rules of my industry the top tier can not talk to the 3rd tier so I have to go through a middleware app that actually talks to the db. Also, being on the top tier I can not have a db of any sort. So this is what I have going on…
20 forms (number of forms dependant on what is entered on the previous form)
600+ fields (again not all used but could be)
Form access based on user groups and access control (Auth db at 3rd tier)
So I have to gather and store the information from the forms, in this case in the session.
So as a user fills out the forms each field is set in the session, then on the commit action I call this massive xml generator (4000+ lines) to build the xml string to send the info to the middleware app, that intern, checks for errors, business logic, and writes to the db on the 3rd tier. At that time it gives me a successful insert xml string back, I put up a completion page with some info that the user needs to print. They then have the option to add another client, or quit. In ether case, I need to dump the session and the information stored.
Now all that to get to the actual issue of when using destroy_session() it does what it should but I loose the users log_key that lets the system know what agent has entered this client. The log_key is used as part of the insert so that if the agent needs to look at their clients they only see their clients. The log_key is generated at the time of login based on the uid, agent, and branch id encrypted in an md5 and then 3dez.
The unset() is a great idea, but am not sure how to implement it and
$_SESSION[‘form_data’][$key]
looks like it would work quite well if I can figure out how to use across the forms since each form field I need to do a
value=" print $_SESSION[‘value_name’]; "
so if they step back the form auto fills with the values of that field….
Again, I have it working with just storing it all in the session but just no way to retain the log_key when we get to the end of the process where I have to kill the session id and the session information.
Whew…If just reading that is painful try having to build to it….ha-ha