Welcome Guest, Not a member yet? Register   Sign In
Problem with CI sessions
#1

[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!
#2

[eluser]PravinS[/eluser]
where have you initialized the session library
#3

[eluser]Unknown[/eluser]
$autoload['libraries'] = array('database', 'session') (In config/autoload.php).




Theme © iAndrew 2016 - Forum software by © MyBB