Rack Sessions getting lost in Chrome

会有一股神秘感。 提交于 2019-12-21 17:34:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!