![]() |
Ajax session - 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: Ajax session (/showthread.php?tid=57478) |
Ajax session - El Forum - 03-18-2013 [eluser]hot_sauce[/eluser] Hi, i need to create or update a session after an ajax call... but it doesn' work! the session is not created or updated! How cai i do? Code: //view Ajax session - El Forum - 03-18-2013 [eluser]davidMC1982[/eluser] In your config autoload the session library. In your controller called by AJAX, do something like: Code: $this->session->set_userdata('name_for_your_data', $data); Unless you do the above, Codeigniter only updates the cookie every 5 mins. See here: http://ellislab.com/codeigniter/user-guide/libraries/sessions.html |