Hi all,

I came to think of something in my code, which might cause a problem, but I am not sure.

After a user of the site has succesfully put a product in the shopping cart - I set a session = 'something'; - to display to the customer (after I have used headers to redirect to another page, and avoid to add extra products if the user refreshes the page.)

How does sessions work, if lets say - there is another customer on the webpage. If he/she browses to same same page as another customer has just been to, and the session hasent been unset yet - will the new customer then see the: session = 'something'; when visiting the page, but without having put anything into the shopping cart yet?

Or is the session only set on the specific customers client/or session??

I hope I have explained so it can be understood outside my head.


Recommended Answers

All 2 Replies

A session is specific to a browser. So if one user is on your website with IE and Opera, then they both have a different session. Same thing for a different user on a different machine.

Thanks pritaeas! It wouldnt be very customer friendly to spit out success messages to everyone when they havent bought anything :-)

So its a good thing to know - I wasnt sure if it was on the server, and displayed generally for everyone one the site.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.