views:

192

answers:

0

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:

function captcha(){
    $this->load->library(array('session', 'kcaptcha/kcaptcha'));
    $this->session->set_userdata('captcha_keystring', $this->kcaptcha->getKeyString());
    //echo $this->session->userdata('captcha_keystring'); //debug
}

view:

<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?