Jump to content
xisto Community
Sign in to follow this  
szupie

Php Sessions I dont really get it...

Recommended Posts

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.