sbeam
sbeam

Reputation: 4892

Rack/Sinatra session breaking when deployed on heroku - E13

I have a basic Sinatra app deployed to Heroku. I have 'enable :sessions' in the app and nothing else do do with sessions except setting/accessing the sessions data. The app works well, but if I have a browser session open, and re-deploy to heroku, then when I use the same browser session, I get "Error H13 (Connection closed without response)" and a Application Error in the browser. I can't find out anything more about the error.

If I delete cookies for the domain, then the app starts working again.

so, again, it's: 1) Deploy app, use app in new browser session, all is well. 2) 'git push heroku master' 3) use same browser, E13

tried setting the Rack::Session::Cookie secret explicity but it makes no difference.

Have also run the app in production mode locally, but can't replicate this.

I'd rather not ruin anybody's day if they happen to be using the app when I do a deploy. Any ideas where else to look to track this down?

Upvotes: 1

Views: 1216

Answers (2)

three
three

Reputation: 8478

You need to set the session secret as well:

configure do
  enable :sessions
  set :session_secret, ENV['SESSION_SECRET'] ||= 'super secret'
end

Upvotes: 1

sbeam
sbeam

Reputation: 4892

This was a Rack 1.4.0 bug concerning the way invalid session digests were handled. github.com/rack/rack/issues/299 problem was solved by upgrade to Rack 1.4.1

Upvotes: 0

Related Questions