Client Side vs Server Side Session
We recently looked at replacing our legacy session management system with a new one. During this analysis, we came close to choosing a client side session but eventually concluded server side was better for us. Here's why... Client side session In this model, all session state is stored in the client in a cookie. The benefits of this are you don't need to worry about persisting and replicating state across nodes, session validation is lightning fast since you don't need to query any data store which means it's super scalable. The session cookie must obviously be tamper proof (to prevent people creating a session of their choice) which is achieved by signing the cookie using asymmetric cryptography. The signing of a cookie value uses the private key, the validation uses the corresponding public key. Our idea was to try and keep the private key as private as possible by storing it in memory only. Each node (4 shown below) would create a new priva...