Я не уверен, почему, но мой сеанс уничтожается при каждом запросе.
Это мой код
require 'rubygems'
require 'sinatra'
require 'sinatra/base'
require 'haml'
require 'facebook_oauth'
class MyClass < Sinatra::Base
set :logging, true
set :sessions, true
get "/auth/facebook_callback" do
// Do some facebook login which is fine
access_token = facebookClient.authorize(:code => params[:code])
session[:access_token] = access_token.token
session[:user] = facebookClient.me.info['name']
session[:id] = facebookClient.me.info["id"]
#print session by "pp session" I can still see all the sessions
redirect '/'
end
get '/' do
#print all the sessions again. And I can't see anything. The session_id is also different
end
end