The first argument is the name of the adapter for the session storage. The default value is , that uses Rack::Session::Cookie
.
The name of the session adapter is the underscored version of the class name under Rack::Session
namespace. Example: for Rack::Session::Cookie
.
Custom storage technologies are autoloaded via require "rack/session/#{ adapter_name }"
.
The second argument passed to sessions
is a Hash of options that are passed to the adapter. We find only a default , but we can specify all the values that are supported by the current adapter.
Usage
To share session values, defined in one application, we must provide the same session secret to all the applications where we need those values.
Set session variable in the first app.