Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Kaustubh's avatar

Redirect based on roles

How to redirect a page after login based on roles

for eg. if admin login he will redirect to admin page and if user login he will redirect to user page

User Table

id  |   name    |   roles   |   password
-----------------------------------------------------------
 1  |   admin   |     a     |   ***********
 2  |   user1   |     u     |   ***********
 3  |   user2   |     u     |   ***********

Is there will be a security problem ..if above solution works?

0 likes
1 reply

Please or to participate in this conversation.