enable :sessions get \'/foo\' do session[\'m\'] = \'Hello World!\' redirect \'/bar\' end get \'/bar\' do session[\'m\'] # => \'Hello World!\' end
Are you using shotgun? If so, do the following:
configure(:development) { set :session_secret, "something" }
This will no longer be necessary in Sinatra 1.3.