private function generateCaptchaValue()
{
if (!$this->keepValue || !$this->session->has($this->key)) {
$value = '';
$chars = str_split($this->charset);
for ($i = 0; $i < $this->length; $i++) {
$value .= $chars[array_rand($chars)];
}
$this->session->set($this->key, $value);
} else {
$value = $this->session->get($this->key);
}
return $value;
}