How does a server know if the current client request is part of a chain of previous requests? Web applications engage with clients through long transactional chains—the shopping cart containing items to buy will still be there even if a shopper navigates away to do some comparison-shopping. We will call this a session, which may contain any number of KV pairs, such as a username, product list, or the user's login history.
How are sessions started, ended, and tracked? There are many ways to attack this problem, depending on many factors existing in different ways on different architectures. In particular, if more than one server is being used to handle clients, how is session data shared between them?
We will use cookies to store session IDs for clients, while building a simple long-polling server. Keep in mind that as applications grow in complexity...