I am using yii2-basic. I created a controller with init() method in it. This init() method will check some cookies and deny access to all actions if the condition doesn't meet. But I don't know how to do it, could anyone help me? Sorry for bad English.
How to block an action or controller without using AccessControl in Yii2?
507 views Asked by user1571234 At
1
You can try Using yii\web\CookieCollection - Refeer to http://www.yiiframework.com/doc-2.0/yii-web-cookiecollection.html
Example: to save cookie:
to retrieve:
Enjoy Yii2!