Permalink
Browse files

cookie sessions

  • Loading branch information...
1 parent fdd4466 commit c85078476aa06ee49b2b53e2697d0cb967decc81 blake.mizerany@gmail.com committed Sep 25, 2007
Showing with 5 additions and 1 deletion.
  1. +4 −0 lib/sinatra/event.rb
  2. +1 −1 lib/sinatra/server.rb
View
@@ -84,6 +84,10 @@ def headers(value = nil)
end
alias :header :headers
+ def session
+ request.env['rack.session']
+ end
+
def params
@params ||= @request.params.symbolize_keys
end
View
@@ -10,7 +10,7 @@ class Server
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

0 comments on commit c850784

Please sign in to comment.