问题
I have an pretty simple app hosted on EC2 built with Sinatra, served with thin behind nginx. The problem is that with Chrome, the session variables get 'lost' in Sinatra. It does not happen in Firefox.
This is using Rack::Session::Cookie. This is similar to this issue: Sinatra not persisting session with redirect on Chrome
Any insights in how to solve this issues in Chrome would be appreciated.
回答1:
Make sure you are setting the following:
configure :development do
set(:session_secret, 'a random string that wont change')
end
configure :production do
set(:session_secret, '*&(${)UIJH$(&*(&*(@(*)(!)))IUYA0984)})')
end
configure do
enable :sessions
end
来源:https://stackoverflow.com/questions/19571757/rack-sessions-getting-lost-in-chrome