MarioApprentice Posted June 19, 2013 Share Posted June 19, 2013 Hello everybody. I have a website where users can login and register. When a existing user logs in, his data (name, surname, age etc...) is saved in an object that is then saved in a session called $_SESSION['user']. I've tested it with one user logged in at a time, but not with multiple users logged in, in the same moment. What will happen if 5 people gets logged in the same moment? Will the $_SESSION['user'] be overwritten with the data from the last user logged in or does php keeps track of the concurent sessions and can distinguish one from another? I think that it can beacuse of unique session id that is stored in a cookie but google searches were somewhat vague and i couldn't find a clear answer. Thank you for your answers. Quote Link to comment https://forums.phpfreaks.com/topic/279346-something-about-sessions/ Share on other sites More sharing options...
MarioApprentice Posted June 19, 2013 Author Share Posted June 19, 2013 never mind this stupid question. i'm just stupid, thats all. Quote Link to comment https://forums.phpfreaks.com/topic/279346-something-about-sessions/#findComment-1436805 Share on other sites More sharing options...
denno020 Posted June 19, 2013 Share Posted June 19, 2013 (edited) I do believe that $_SESSION actually saves to the users browser session, so they will only ever have their own user data. I could be wrong, but that's what I've always assumed.. Edit: Just saw your reply. It's not stupid to ask a question if you're unsure. How else will you ever be certain about the answer? Edited June 19, 2013 by denno020 Quote Link to comment https://forums.phpfreaks.com/topic/279346-something-about-sessions/#findComment-1436806 Share on other sites More sharing options...
MarioApprentice Posted June 19, 2013 Author Share Posted June 19, 2013 my knowledge about php sessions is at not at proffesional level, but php sessions have a unique id from which php can distinguish them from other concurent sessions. i didn't even need google for this beacuse it makes sense on its on. that is why i'm stupid. but hey, if you think i'm not stupid, call me a genius Quote Link to comment https://forums.phpfreaks.com/topic/279346-something-about-sessions/#findComment-1436808 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.