szupie 0 Report post Posted February 4, 2005 Are php sessions unique for each site? If my site gave a session named "abcd" to a user, but he/she already has a session called "abcd" on another site, is it going to replace the one on the other site, or are those two not recognized as the same on the user's computer? Share this post Link to post Share on other sites
iGuest 3 Report post Posted February 4, 2005 Are php sessions unique for each site? If my site gave a session named "abcd" to a user, but he/she already has a session called "abcd" on another site, is it going to replace the one on the other site, or are those two not recognized as the same on the user's computer? <{POST_SNAPBACK}> What you are thinking of is cookies which contains the domain name in the cookie to differentiate the other sites, PHP Sessions reside on the Server computer, not the client. The server keeps track of your session with all information like IP, time, maybe browser, etc. Just look at it if you bought a movie ticket, the ticket is your session with a set time limit from when the movie starts till it ends. You can not use that session to visit another movie unless you paid for another session. The cinema is the host (Server) of that session, if they had many branches (sites), usually you can't buy a movie ticket in one area and expect to watch it in another as their screening times, seating plans etc are different. OK maybe not a good anecdote but hopefully you see that sessions reside on the server, and not on your own computer. MC Share this post Link to post Share on other sites
szupie 0 Report post Posted February 4, 2005 Oh... So all the sessions are on the server, and they recognize the users, instead of having the users recognize them...Thanks, now I get what sessions are! Share this post Link to post Share on other sites
miCRoSCoPiC^eaRthLinG 0 Report post Posted February 4, 2005 Just look at it if you bought a movie ticket, the ticket is your session with a set time limit from when the movie starts till it ends. You can not use that session to visit another movie unless you paid for another session. The cinema is the host (Server) of that session, if they had many branches (sites), usually you can't buy a movie ticket in one area and expect to watch it in another as their screening times, seating plans etc are different. OK maybe not a good anecdote but hopefully you see that sessions reside on the server, and not on your own computer. MC <{POST_SNAPBACK}> Haha.. nice one - I would be convinced for one Share this post Link to post Share on other sites
coder2000 0 Report post Posted February 7, 2005 Actually sessions can be stored anywhere including in cookies. But they are only for the server that gave it. So the description above is still correct. Share this post Link to post Share on other sites