Welcome Guest, Not a member yet? Register   Sign In
Losing the value of only one session variable after AJAX call
#1

[eluser]Unknown[/eluser]
Hello,

I have a problem, when I make a AJAX request to retrieve more data, a session variable called is_logued which indicates is the current user is logued in the system lose its value.

I have test it with the rest of the page and it is ok, no problems. The problem comes when the ajax request is sent.

I have make a debug in the Session class, but I cannot find anything extrange. I make a print_r to the values and the variable is correctly set inside the Session Class. Moreover, the values are stored in the database in the CI_SESSIONS table.

Here I have made a check...

Code:
public function load_next_links($param)
{
  $this->load->helper('principal_helper');      

  echo "is_logued value  ".$this->session->userdata("is_logued");

  echo get_next_links($param);

  echo "is_logued value ".$this->session->userdata("is_logued");

}

In both cases is_logued value has the correct value 1. This fuction is located in the principal controller. But after the call the database has the value 0. why??

Even more, I have print the values stored in the database in the last line of the CodeIgniter.php (core) and the bbdd has the good value!! why when I saw the database the value is not the correct? where is this value being modified??

Anyone knows what is happeing? Is there any process that writes in the session table without using the Session library? It is very strange because only is_logued lose its value. I have check is I do it manually but does not. Nobody calls unset to that variable.
#2

[eluser]Sudz[/eluser]
Can you post your controllers code and function to which you are calling via ajax?




Theme © iAndrew 2016 - Forum software by © MyBB