CodeIgniter Forums
Losing my session with AJAX calls - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Losing my session with AJAX calls (/showthread.php?tid=46585)



Losing my session with AJAX calls - El Forum - 11-07-2011

[eluser]Unknown[/eluser]
Hi everyone,

First of, I know this is a known problem and I've just spent 3 hours going through the solutions people already posted on this forum about this specific problem. Though nothing worked and I'm running out of ideas.

I created my own session class like suggested here: http://ellislab.com/forums/viewthread/138823/, changed the config to increase the sess_time_to_update, etc.

Nothing worked and I still lose my session.
Here's the relevant controller code from my app, nothing fancy really:

Code:
public function interest($categoryName = "")
  {
    error_log(print_r($this->input->request_headers(), TRUE));

    if (!empty($categoryName))
    {
      $this->load->library('session');

      if (!isset($this->session->userdata['userID']))
        show_error("blablabla", 403);
      [...]

As you can see I print the headers and I do receive a cookie with the session_id, ci_session, user_agent,...