codeigniter函数以不同的方式加载两页相同的函数调用

I am using two ways for user login in codeigniter:

  1. One is by typing url like this localhost/mySite/login
  2. Other is popup dialog appear when I click a link from localhost/mySite

When I'm following step 2 then calling a function using ajax request. both time I am calling same function. but when call to the function using Ajax load an additional header.

I used following code for the calling function.

if ($this->input->is_ajax_request()){                                                                                                  

    echo json_encode(array('status'=>'success','url'=>'auth/enable_account'));
    exit();
}
else {
    redirect ( "auth/enable_account",'refresh');
}

My jquery code

jQuery('#signin_form').submit(function(event) {
        var email = jQuery('#email').val();
        var password = jQuery('#password').val();
        var remember = jQuery('.dev_signin_remember').is(':checked');
        jQuery.ajax({
            url:baseurl+'auth/login',
            type:'POST',
            data:{'email':email,'password':password,'remember':remember},
            dataType:'json',
            success:function(data){
                if(data.status == 'success') {
                    if(data.url != '') {
                        window.location.replace(baseurl+data.url);
                    }
                    else {
                        window.location.replace(baseurl+"auth/login");
                    }
                }
                else {
                    jQuery('.dev_signin_error').html('Invalid Username or password');
                }
            }
        });
    setTimeout(jQuery.unblockUI);
});