Welcome Guest, Not a member yet? Register   Sign In
Losing session variables
#1

[eluser]Unknown[/eluser]
Hi to all,

I have been trying to figure this out and none of the forum postings have helped me.

I have 5 controllers with their corresponding views. I am creating an application that saves session variables from the previous forms and runs an external executable during the last step.

This is my current chain of events:

View 1 -> View 2 -> View 3 -> View 4 -> View 5

The controller for View 2 saves the POST variables from view 1, the controller for View 3 saves POST variables for View 2, and so on.

For View 2 I have three drop down lists whose values are saved and shown in View 3 but lost on Views 4 and 5.

If I print all my session variables in View 5, I get valid values for Views 1, 3, and 4 but the three variables for View 2 are lost. I have tried recreating the controller and view for step 2 but can not figure our what's wrong.

This the way I am saving the POST variables from view 2 in the controller of View 3:
Code:
$climate_sess_vars = array(
               'scenariostate'   => $_POST["statelist"],
               'scenariostation' => $_POST["climateslist"],
               'scenariosoil'    => $_POST["soilslist"]
            );
        
        $this->session->set_userdata($climate_sess_vars);

I am not sure if this should matter but I do have an IFrame in view 4. I have tried running the application without the IFrame and I see no changes to the way the sessions variables are being saved.

I would appreciate your help on this. Smile
#2

[eluser]Unknown[/eluser]
I have already resolved this issue. For some reason, when I switched the order of views 3 and 4, all session variables are being saved correctly. Smile




Theme © iAndrew 2016 - Forum software by © MyBB