Web Technology Basics

Three application servers are placed behind a load balancer, which distributes requests to them in turn (round robin). The session information of a logged-in user is stored only in the memory of the server that handled the login. Which of the following is an appropriate pair of a likely problem and its countermeasure?

  1. AWhen a request goes to another server, the session is not found and the user appears to be logged out. Keep sessions in a shared store that all servers can use
  2. BThe three servers issue the same session ID separately and the IDs collide. Make session IDs short sequential numbers so that users can remember them
  3. CThe load balancer cannot read cookies, so HTTPS stops working. Stop encrypting the traffic between the load balancer and the servers
Show answer and explanation

Answer: A. When a request goes to another server, the session is not found and the user appears to be logged out. Keep sessions in a shared store that all servers can use

If session information exists only in one server's memory, a server that receives the next request cannot identify the user when the request is distributed to it. One countermeasure is to keep sessions in a shared store that every server can read and write (an in-memory data store or a database). Another is session persistence (sticky sessions), which keeps sending the same user's requests to the same server, but sessions are lost if that server stops and the load also tends to become uneven. Keeping servers stateless makes it easy to add or remove servers.

  • A. Correct. With a shared store, every server can use the same session.
  • B. Session IDs are made long enough and random so that they cannot be guessed. Making them short increases the risk of impersonation.
  • C. The session problem has nothing to do with HTTPS. Stopping encryption only lowers security.
Practice this topic Back to topic

Books on Web Technology Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Web Technology Basics questions

  1. Which of the following correctly describes a typical signed JWT (JSON Web Token)?
  2. A photo-printing app, with the user's permission, reads the user's photos stored on another company's photo storage service. In OAuth 2.0, which of the following roles shows the user a screen asking for permission and, when the user agrees, issues an access token to the app?
  3. Which of the following correctly describes the relationship between OAuth 2.0 and OpenID Connect?
  4. Which of the following is an appropriate web API design that follows the principles of REST?
  5. A browser opens https://www.example.com:8443/docs/guide.html?lang=ja#install. Which part of this URL is not included in the request sent to the server and is used only inside the browser after the page loads?