Answer the question
In order to leave comments, you need to log in
How to beat the session of a banned user?
Hello.
There is an application on CodeIgniter where users register.
There is a table in a DB where the data of the user is stored.
Each user has a Role - authorized, moderator, administrator, banned, deleted.
After authorization, the user's data is transferred to the session, where they "live".
Let's say I, as an administrator, want to ban a user. I change his Role to "banned".
But it turns out that the user will be able to write comments and behave like a normal user until his session expires.
You can, of course, pull the database for each user to check the Role and if the Role in the session does not match the Role in the database, kill the session. But then the whole point of storing user data in the session is lost.
Can you please tell me the best way to implement this thing?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question