Hi .
Currently I have a class in the constructor stores variables in $_SESSION
.
I was told not to store the user_id
in $_SESSION
, because then a user could change the ID to a one of his liking, and then access the website freely from any account.
Instead, I've stored a session_id
and created a table that has links a session_id
to a user_id
.
My question is - how difficult is it to manipulate this data? I also have a store system on my project, and I realized that I wouldn't be able to store things like the store's owner ID in a $_SESSION
variable. This would lead to me querying the database every page, at least, to get the data.
How insecure is it to store this type of information in $_SESSION
? Does anyone have a better solution?