Nowadays having a login system in a FE to control users permission is quite popular. I've seen a lot of posts here and a lot more on other sites. It's very easy to have a login form and verify if an encrypted password matches user's input. Let him in if the authentication passes, or keep him out if it fails.
What I'm interested in here is how do you save the login info (mostly user ID) to control his permissions after a successful login.
Using a global variable, updating user table and saving the session info or use a class are some possible ways. I've also seen some databases that logged in user ID is set in a hidden text box in a form (normally switchboard).
There may be more possible solutions too.
As the title says, how do you keep a track of the user to identify his permissions after a successful login and why you chose this method?
And if possible, some pros and cons of your method over others.
Many thanks for your time.
What I'm interested in here is how do you save the login info (mostly user ID) to control his permissions after a successful login.
Using a global variable, updating user table and saving the session info or use a class are some possible ways. I've also seen some databases that logged in user ID is set in a hidden text box in a form (normally switchboard).
There may be more possible solutions too.
As the title says, how do you keep a track of the user to identify his permissions after a successful login and why you chose this method?
And if possible, some pros and cons of your method over others.
Many thanks for your time.