mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
cookie sessions
This commit is contained in:
parent
fdd44669bc
commit
c85078476a
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue