Question

I am using Recess Framework for my application & troubled with session handling. I need to store some values in the session.. I am able to create session and session id. But as soon as i navigate to another page, I am not able to retrieve them back !! How to do you people manage your sessions? PHP session handling is simple and straight forward.. but I am simply not able to get this right!

In my home controller I have:

/* !Route GET, / */
function index() {
   .
   .
   session_start();
   $_SESSION['val'] = 'SomeValue';
   .
   .
}

My view displays another form and when user submits, I need to access the session val as well.. so I try to get the value back as:

/* !Route GET, /check */
function check() {
    if(isset($_SESSION['val'])){
       .
       .
       .
    }       
}

But unfortunately, i don't enter the if block .. i am not able to see what my mistake is I tried displaying the session is using session_id() as well and its blank value in check() method.

I also noticed that, all the time I create a new session, the session_id is same!! is it like that in PHP? As far as I read, they should be different!

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top