You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The user data of the logged in user is set to a session in the login function. But these variables seem too unspecific. Just having the user id as $_SESSION['id'] seems it could be in the risk for being overridden by something else with an id that it wants to save in the session.
A better way seems to me to be to store all these variables in an user-array and save that in the session. This is easily done by just adding one small thing in the session saving. Something like this:
The user data of the logged in user is set to a session in the
login
function. But these variables seem too unspecific. Just having the user id as$_SESSION['id']
seems it could be in the risk for being overridden by something else with an id that it wants to save in the session.A better way seems to me to be to store all these variables in an user-array and save that in the session. This is easily done by just adding one small thing in the session saving. Something like this:
This would result in the user data being available from
$_SESSION['user']['id']
etc.The text was updated successfully, but these errors were encountered: