I’ve created an application in Yii where you can do a simple login. Once I am signed in, I am basically in as long as my session persist. However, I would like to do a status check on every page visit for a user to ensure that he still has permissions to access the site (e.g. if the user gets inactived then he should not stay logged in).
What is the best approach to authenticate the user on every page; is it on Controller level, Controller method level, View level or some other way? Ideally it would be the easiest if the check is included once per controller. Can you please advise how you have done this?