我似乎无法让这些会话继续进入其他页面。
app.rb:
class MyApp < Sinatra::Base
use Rack::Session::Pool, :expire_after => 60 * 1
get "/" do
@foo = "one two three"
erb :index
end
get "/first" do
session[:foo] = Time.now
session[:message] = "ALPHA"
session[:message1] = "CHARLIE"
erb :first
end
get "/second" do
session[:message2] = "BRAVO2"
erb :second
end
end
Inside / first和/ second:
Sess: <%= session.inspect %><br>
会话不想跨页面。在/首先我显示这个:
Sess: {"message"=>"ALPHA", "message1"=>"CHARLIE", "foo"=>2015-12-01 17:05:31 -0500}
开/秒我显示:
Sess: {"message2"=>"BRAVO2"}
答案 0 :(得分:1)
只需要重启。图。