CI session and session ID - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: CI session and session ID (/showthread.php?tid=28229) |
CI session and session ID - El Forum - 03-05-2010 [eluser]haXis[/eluser] Hello, I have a cart database table with session column which represent the CI session_id. My question is - is there any way how to recognize that the session_id changed? Debug session action: Code: SELECT * Without changing the session ID in a cart I loose him and I dont want that before 7200 seconds. CI session and session ID - El Forum - 03-05-2010 [eluser]haXis[/eluser] I did a little research in code and I think the best solution is add an extra db query in the Session library. After Code: $this->CI->db->query($this->CI->db->update_string($this->sess_table_name, array('last_activity' => $this->now, 'session_id' => $new_sessid), array('session_id' => $old_sessid))); Add Code: $this->CI->db->query($this->CI->db->update_string('my_table', array('session_id' => $new_sessid), array('session_id' => $old_sessid))); Hope that helps anyone else with similar problems. Another suggestions are welcomed. |