diff --git a/lib/sinatra/event.rb b/lib/sinatra/event.rb index acc67092..6444780c 100644 --- a/lib/sinatra/event.rb +++ b/lib/sinatra/event.rb @@ -84,6 +84,10 @@ module Sinatra end alias :header :headers + def session + request.env['rack.session'] + end + def params @params ||= @request.params.symbolize_keys end diff --git a/lib/sinatra/server.rb b/lib/sinatra/server.rb index bf4bac85..c1b9ad79 100644 --- a/lib/sinatra/server.rb +++ b/lib/sinatra/server.rb @@ -10,7 +10,7 @@ module Sinatra def start begin tail_thread = tail(Options.log_file) - Rack::Handler::Mongrel.run(Dispatcher.new, :Port => Options.port) do |server| + Rack::Handler::Mongrel.run(Rack::Session::Cookie.new(Dispatcher.new), :Port => Options.port) do |server| puts "== Sinatra has taken the stage on port #{server.port}!" trap("INT") do server.stop