开发者

Ruby Singleton and Shotgun

Im starting with Ruby and our team leader sends us to learn Sinatra, relo开发者_开发知识库ading the application changes is been done by Shotgun, my problem now is that i have a Singleton entity which i would love to keep states between request, but aparently Shotgun restarts is every request.

Any Help or Explanation on this would be apreciated,

Thanks in advance.


You shouldn't expect anything about your application's state to be saved between requests at all (Shotgun or not) unless it is being saved in session data.


For sessions to persist with Shotgun you need to set the key... Otherwise it is reset with every page load.

enable :sessions
set :session_secret, "yourKey" 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜