AJAX PHP Redirect
===

Im posting a form via AJAX, if its successful it is to redirect to another page. The form submits successfully but fails the redirect part.

In my chrome developer toolbar it displays the right request url with the request method GET and status code 200 OK.

The JavaScript looks like:

    $('#submit-login').live('click', function(e) {
		e.preventDefault();
		
		var username = $('#username').val();
		var password = $('#password').val();
		
		var dataString = 'username=' + username + '&password=' + password;
		
		$.ajax({
			type: 'POST',
			data: dataString,
			url: '/account/do_ajax/login',
			dataType: 'json',
			success: function(data) {
				if(data.redirect) {
					window.location.href = data.redirect;
				} else {
					$('.message').hide();
					$('.message').html(data);
					$('.message').fadeIn('slow');
				}
			}
		});
	});

And the PHP

      public function do_ajax($type) {
		if($type == 'login') {
			$this->_submit_login();
		}	
	}

      public function _submit_login() {
		if($this->form_validation->run('login')) {
			$data = array(
				'username' => $this->input->post('username'),
				'password' => sha1($this->input->post('password'))
			);
			$authenticate = $this->account_model->authenticate($data['username'], $data['password']);
			if($authenticate) {
				$this->session->set_flashdata('success', 'You have successfully logged in.');
				redirect('/account');
			} else {
				echo json_encode('Could not log you in, your details are incorrect.');
			}
		} else {
			echo json_encode('<ul class="errors">'.validation_errors('<li>', '</li>').'</ul>');
		}
	}

Any ideas where im going wrong? Thanks in advance.