In your rackup file:
%w(rubygems rack sinatra).each { |dependency| require dependency }
disable :run
require 'myapp'
sessioned = Rack::Session::Pool.new(
Sinatra::Application,
:domain => 'example.com',
:expire_after => 60 * 60 * 24 * 365 # expire after 1 year
)
run sessioned
To launch run rackup app.ru
, or use Passenger, etc. This ought to wrap your application in the session pool and enable its functionality. I don't entirely know why it doesn't need use like most other middleware.
Understand that I haven't tested this at all, I haven't had something that needed session pools yet. I wrote this from the documentation for Rack::Session::Pool, which had an example at the top of the page. So, I can't tell you exactly how to use it either.