Yii Error 400 O token CSRF não pôde ser verificado ao tentar excluir a postagem
Quando eu estava tentando excluir uma postagem, recebi este erro:
Yii Error 400 The CSRF token could not be verified
Eu não sei exatamente o que está causando isso e com o que isso poderia estar relacionado. aqui está minha ação delete:
public function actionDelete($id) {
if (Yii::app()->request->isPostRequest) {
// we only allow deletion via POST request
$this->loadModel($id)->delete();
// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
if (!isset($_GET['ajax']))
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
}
else
throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
}
protected function afterDelete()
{
parent::afterDelete();
Image::model()->deleteAll('name='.$this->id);
Date::model()->deleteAll('tbl_show_id='.$this->id);
Press::model()->deleteAll('tbl_show_id='.$this->id);
}