why codeigniter captcha doesn't change in internet explorer?

171 Views Asked by At

i create a login page with codeigniter 3. my captcha code works perfect in firefox and other modern browsers. but in internet explorer if you refresh the page it DOESN'T CHANGE. whats wrong with my codes?

Here is the link to the page: http://www.artavil.ir/myadmin/

My captcha code:

function create(){

    $rand = rand(1000,9999);


    $config_captcha = array(
        'word' => $rand,
        'img_path'=> './captcha_pic/',
        'img_url'=> 'http://artavil.ir/myadmin/captcha_pic/',
        'img_width' =>'150',
        'img_height' =>'30',
        'expiration' => 7200
    );
    $captcha = create_captcha($config_captcha);

    echo $captcha['image'];

}
1

There are 1 best solutions below

3
On BEST ANSWER

Chances are it's getting cached. Try this in your JS to prevent caching:

$("#captcha").load("http://www.artavil.ir/myadmin/captcha/create?" + Date.now());