In this recipe, we will work with session manager data type, SessionManager in Snap. The HTTP is a connection-less protocol, and the concept of a session has to be built on top of the interaction between client and server. The session is usually represented by some key-value pair that can be persisted across the interactions between a client and the server. In HTTP, this can be done in multiple ways--one of the most popular ways of handling a session is to set the session cookies. The session cookies are retained by the browser for a particular interaction duration.
In this recipe, we will set session cookies through cookie based the session manager in Snap.