I was told that one common reason of storing sessions in a database is to make it cross-server. But isn’t a TCP connection persistent until one closes the browser? Why the next request may switch a different server?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Once the web page loads, and all the images, css files and other assets are retrieved, the TCP connection will close shortly afterwards (after 5 seconds by default in Apache 2.2, for example). When the user clicks on some other internal link, a new TCP connection is opened. This may end up on another server in a multi-server, load-balanced scenario.