Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Although HTTP is itself a stateless protocol, one way to maintain
the state for a user is through the use of cookie-based
sessions, demonstrated in Example 2-33. In this
approach, a cookie (in this case, one named rack.session) is stored client-side and used to
house data related to the activity in the current user’s session.
A more thorough discussion of cookies in general is up next.
You can enable sessions via the configure block. Once enabled, the session object can be used to store and retrieve
values.