Jump to content

something about sessions


MarioApprentice

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/279346-something-about-sessions/
Share on other sites

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? :)

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 :tease-01:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.