[eluser]bmgz[/eluser]
I am trying to use Kcaptcha with codeigniter. I created a function in the controller to output the image but the session var is not being set afterwards:
controller:
Code:
function captcha(){
$this->load->library(array('session', 'kcaptcha/kcaptcha'));
$this->session->set_userdata('captcha_keystring', $this->kcaptcha->getKeyString());
}
view:
Code:
<img src="quiz/captcha" />
When I disable the image headers and image output on the kcaptcha class, then the captcha session var is set, but when they are enabled the session variable is not set?
this is the tail of the Kcaptcha class..
Code:
...
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');
if(function_exists("imagejpeg")){
header("Content-Type: image/jpeg");
imagejpeg($img2, null, $jpeg_quality);
}else if(function_exists("imagegif")){
header("Content-Type: image/gif");
imagegif($img2);
}else if(function_exists("imagepng")){
header("Content-Type: image/x-png");
imagepng($img2);
}
}
// returns keystring
function getKeyString(){
return $this->keystring;
}