I have a script creating a session variable of type $_SESSION['user'] = $row['username'] where $row['username'] is the username of a user who logs successfully in the system.
However, if another user logs in the system successfully in a subsequent phase, $_SESSION['user'] takes a new value corresponding to the newly logged in user. This is causing me problems because i am inserting the username(which is unique in the user table) to identify which user is inserting data in comments table. Because my application is on a network and the session is managed on the server, a user can insert someone's else username when he is sending data in the comments table because $_SESSION['user'] always takes on the last value of a logged in user. Please, WHo can tell me what to do in order to assign a different session variable to every user? This would help me to identify which user inserted which comment.
Thank you in advance for your help