title: Yii 2.0 CSRF validation for AJAX request
body: <p>I have an <code>ajax</code> function that triggers an entry deletion from my database. </p>
  
  <p>I need to do <code>CSRF</code> validation for the same. How can I do that?</p>
  
  <p>I am sending the <code>CSRF cookie</code> along with my post request, but <code>Yii 2.0</code> is not validating it and any input that is passed through ajax is reaching the server.</p>
  
  <p>How do I do <code>CSRF</code> validation for ajax requests.</p>
  
  <p>Whether we need to manually set cookie and check?</p>