Yii Ajax request CSRF can not be verified -


i use few different ajax calls in 1 of pages through couple of different methods.

  1. chtml::link()
  2. chtml::ajax()
  3. within cgridview

since enabling csrf i'm having difficulty verifying token. correct way? i've read few posts, struggling implement. instance in chtml::link() i've tried:

'data' => "yii::app()->request->csrftokenname = yii::app()->request->csrftoken", 

and within cgridview:

data: {     yii::app()->request->csrftokenname => yii::app()->request->csrftoken }, 

1- fot ajax have ajax, ajaxlink , ajaxbutton not link.

2- csrf token works when use post request

3- add csrf token this:'data'=>array('yii_csrf_token' => yii::app()->request->csrftoken)`


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -