I'm using CodeIgniter for my project. I'm near end and I cannot change session "engine" now. I have captcha image for comment posting on url:
example.com/captcha
and code:
this->load->library('session');
header("Content-type: image/jpeg");
/*
* Image generation code...
*/
$this->session->set_userdata('captcha', strtolower($word));
imagejpeg($image);
imagedestroy($image);
Usually when I'm submitting a form I use
<img src="example.com/captcha" />
to generate image and set userdata. But this time it doesn't work. $this->session->userdata('captcha') is empty.
But if I visit image directly sessiondata is set and on next submit there is a $word which was generated on direct access of image/captcha. What could cause this?