title: The connection was reset issue in CakePHP 2.2
body: <p>I am new to cakephp when i am trying to make dynamic drop down list of cities on the basis of states then i am getting this error</p>
  
  <pre><code>The connection was reset.
  </code></pre>
  
  <p>My js code is </p>
  
  <pre><code>$(document).ready(function(){
  $('#UserState').change(function(){
    var stateid=$(this).val();
    $.ajax({
    type: "POST",
    url: "checkcity",
    data:'stateid='+stateid+'&amp;part=checkcity',
    success: function(data) {
    $("#city_div").html(data);
    }
    });
  });
  });
  </code></pre>
  
  <p>And for this  i am using function checkcity on User controller. here is my user controller file.</p>
  
  <pre><code> class UsersController extends AppController {
   public $uses=array('User', 'City','State');
   function index(){
  
    }
    public function add() {
  
      $this-&gt;set('states_options', $this-&gt;State-&gt;find('list', array('fields' =&gt;array('id','name') )));
  $this-&gt;set('cities_options', array());
      if ($this-&gt;request-&gt;is('post')) {
          $this-&gt;User-&gt;create();
          if ($this-&gt;User-&gt;save($this-&gt;request-&gt;data)) {
              $this-&gt;Session-&gt;setFlash(__('The user has been saved'));
              $this-&gt;redirect(array('action' =&gt; 'index'));
          } else {
              $this-&gt;Session-&gt;setFlash(__('The user could not be saved. Please, try again.'));
          }
      }
  }
  
  public function checkcity(){
  $this-&gt;layout=false;
  $stateid=$this-&gt;request-&gt;data['stateid'];
  $this-&gt;set('cities_value',$this-&gt;City-&gt;find('list', array('conditions' =&gt;    array('state_id' =&gt; $stateid), 'fields' =&gt; array('id', 'name')));
  }
  }  
  </code></pre>
  
  <p>Now when i put this line in my controller file </p>
  
  <pre><code>       $this-&gt;set('cities_value',$this-&gt;City-&gt;find('list', array('conditions' =&gt;    array('state_id' =&gt; $stateid), 'fields' =&gt; array('id', 'name')));
  </code></pre>
  
  <p>then i get this error. Can anybody tell me what is the issue in it?</p>