In a normal login system where user inputs username and password,
post vars, check them in a db table, and the redirect to the restricted area,
where a session starts and some data are registered to keep track of the user, and check if authorized:
how many session vars better to register? to avoid people from tryin to enter without authorization?
for example is it sufficient to register username plus his id in the authUsersTable
so i can perform the auth check by a SQL query where both the couples match?