Logout Error

Hi,

when i try to logout i get this error:

Method Not Allowed. This url can only handle the following request methods: POST.

any help ?

Seems like javascript is not working correctly. The logout link should send an ajax POST request.

Check for last updates/fixes in application.

Add <?= Html::csrfMetaTags() ?> to head section in backend and frontend/views/layouts/main.php

Thanks

iam using extension from dektrium/yii2-user

and i have the latest one. i have posted an issue… letz see.

<?= Html::csrfMetaTags() ?> this has solved my probleme… but i dono what the probleme was maybe u can explane me :D

This is necessary because View has been changed to not add it automatically anymore. See https://github.com/yiisoft/yii2/blob/master/framework/UPGRADE.md#upgrade-from-yii-20-beta last point.

i m getting same error

below is my code so plz help me how to pass post with below code

                            &lt;li&gt;


                                &lt;a href=&quot;&lt;?php  echo Url::toRoute('/site/logout');?&gt;&quot;&gt;


                                    &lt;i class=&quot;ace-icon fa fa-power-off&quot;&gt;&lt;/i&gt;


                                    Logout


                                &lt;/a&gt;


                            &lt;/li&gt;