![]() |
Problem with CI sessions - 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: Problem with CI sessions (/showthread.php?tid=59212) |
Problem with CI sessions - El Forum - 09-05-2013 [eluser]Unknown[/eluser] Hi, i have a problem with CI sessions. This is my code: cycle $this->load->library('image_moo'); // Upload image and return unique name $data = array( 'image' => $image, ); $this->db->insert('category_images', $data); if (!$this->session->userdata('uploadImages')) { $this->session->set_userdata('uploadImages', $this->db->insert_id()); } else { $session = $this->session->userdata('uploadImages'); $sessionData = $session.'|'.$this->db->insert_id(); $this->session->set_userdata("uploadImages", $sessionData); } echo $this->session->userdata('uploadImages'); // return 256; corect result - 255|256 end of cycle This is script for image upload with jQuery File Upload(blueimp) and i need set ids of inserted in database images to session. Can anyone help. Thank you! Problem with CI sessions - El Forum - 09-05-2013 [eluser]PravinS[/eluser] where have you initialized the session library Problem with CI sessions - El Forum - 09-05-2013 [eluser]Unknown[/eluser] $autoload['libraries'] = array('database', 'session') (In config/autoload.php). |