Welcome Guest, Not a member yet? Register   Sign In
Inconsistent Session Data
#1

[eluser]Unknown[/eluser]
Hi All,

I have an inconsistent session data case. In my code, I generate some random md5 has value, and pass it to both a session variable and also pass it as a value in my hidden control.

Code:
$this->load->library('session');

$this->data["somevalue"] = md5(rand(8999,19999));

$newdata = array(
           'sessionpass' => $this->data["somevalue"]
       );

$this->session->set_userdata($newdata);

For example, the value generated is 043ea4eb48d314b91e95fb5052d3d8f0. And when I submit the page again I've got different value.

Code:
echo $_POST["sessionpassval"]; //this is input hidden field, got 043ea4eb48d314b91e95fb5052d3d8f0
echo $this->session->userdata("sessionpass"); //returns  665a24a314ec348b3b2ac1e3eb26dae0

Is there any explanation on this ?

Thanks,

JarBis




Theme © iAndrew 2016 - Forum software by © MyBB