Rack Sessions getting lost in Chrome
Asked Answered
L

1

6

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.

Leatheroid answered 24/10, 2013 at 16:41 Comment(1)
I'm having the same exact issue with Chrome (i.e. works on Firefox, Safari). Do you remember the issue?Secessionist
P
0

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
Philipson answered 24/10, 2013 at 17:56 Comment(1)
Yes, I have a secret set and sessions enabled. Like I said: sessions are working but in Chrome the session information disappears on certain requests. I think it has to do with chromes handling of the cookie.Leatheroid

© 2022 - 2024 — McMap. All rights reserved.