Welcome Guest, Not a member yet? Register   Sign In
CSRF only in one page
#2

(09-08-2021, 07:56 PM)nneves Wrote: Hi

What's the best approach to use CSRF only in one page without using the Filter?

I need to remove all cookies for cache propose.

Thanks

You can add csrf fields in the view of that page  and then in the controller check it manually.
But filters is convenient. If you want csrf just in one page you can use filters array inside app/config/filters.php config file. 
PHP Code:
'csrf' => ['before' => ['myspecialpage/index']] 

So this will apply only in one page.
Reply


Messages In This Thread
CSRF only in one page - by nneves - 09-08-2021, 07:56 PM
RE: CSRF only in one page - by manager - 09-08-2021, 09:46 PM
RE: CSRF only in one page - by nneves - 09-09-2021, 01:06 AM
RE: CSRF only in one page - by manager - 09-09-2021, 10:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB