Validate CSRF token with session

Hello!

Iam trying follow this guide but but i got the follow error “ReflectionException: Class application.components.HttpRequest does not exist”

https://www.yiiframework.com/wiki/274/how-to-validate-csrf-token-with-session

i’m using the advanced template but i dont understand where put that Class, i try in “/backend/components/HttpRequest” and “/components/HttpRequest” and “/frontend/components/HttpRequest” and i have the same error

any idea?

Hello @Brz,

The wiki you mentioned is for Yii 1.1.
For Yii2 advanced template, you have to edit ‘frontend/config/main.php’ and ‘backend/config/main.php’.

1 Like