I’ve implemented the auto-login feature so that a user will be authenticated based on a cookie when he returns to the site.
Now I would like to be able to ban a user (set "valid" = 0 in my user table). I have two problems:
- I need to prevent the user to be able to auto-login from a previous cookie if valid=0 in the user table
Solution:
->extend CWebUser and override restoreFromCookie()
->check if the user is still valid before authenticating
- If the user is already logged-in and its session is still active, how can I log him out or at least prevent him to do any action. I want to avoid using CDbHttpSession
-> can I reset all sessions? (this would work for me since it won’t happen very often)
Thank you!