Sessions not persisting through requests 5.0.0beta1 #1310

TheNaoX opened this Issue Dec 2, 2014 · 9 comments


None yet

3 participants

TheNaoX commented Dec 2, 2014

Hi guys,

I've been playing with passenger 5 beta with a Rails application for a week now and I just noticed that the Rack session variables are not persisting through requests (including cookies) and I don't know why this is happening, I've been reading a lot the documentation you have but It doesn't really cover that scenario, I tried to change the --spawn-method to direct and it doesn't work anyway.

I thought it was a design issue of my application, however, all my spec files are working properly and it also works if I use WEBrick or any other web server.

Thanks in advance!


Rails sessions are stored in cookies by default, and 5.0.0 beta 1 has a known bug related to cookie handling: #1296
It should work if you try the version from git master.

TheNaoX commented Dec 2, 2014

Thanks so much for your response, I'll use the master branch as reference and let you know if it worked

TheNaoX commented Dec 2, 2014

Unfortunately it's not working, I set a value in a Rails controller like this:

# Controller details not necessary
def index
  session[:foo] = "bar"

And then in another controller context:

# Controller details not necessary
def create
  if session[:foo] == "bar"
    # ...

But it returns:

# => nil

Instead of:

# => "bar"

And it works perfectly fine with other web servers such as WEBrick, Please let me know if I am missing something.


@FooBarWidget FooBarWidget added this to the 5.0.0 beta 2 milestone Dec 3, 2014

Let me investigate this then.


I can't reproduce this problem. Both sessions and cookies work perfectly for me, using the latest git master.

Could you use the browser's dev tools to capture some network traffic and show me the request and response headers that are being sent?

TheNaoX commented Dec 18, 2014

I'll do that and give you the information you need, thanks!

TheNaoX commented Dec 19, 2014

Hi @FooBarWidget here's the whole session on each response, I just updated to 5.0.0.beta2 this morning and the session values that I set manually seem to work, but the devise sessions are not persisting when I'm trying to authenticate, hopefully this will give you enough information for what you need. As additional information Devise sessions were persisting fine in 5.0.0.beta1

Remote Address:
Request URL:
Request Method:GET
Status Code:200 OK

Request Headers

Accept-Encoding:gzip, deflate, sdch
Cookie:__ngDebug=true;;; fbsr_261680850639195=XyuiOCGzUs4GZkKylCBdYOFyQ5X0YRTnEhkjDLkpAfI.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiJBUURZbGdxTXd4RkFHVjVyQTZPWHZob3hnSzc5cnRvTndYMjI2TnRzVU5tMVhDV2dGdC1ZWUJheXE4Y2QzSndpdldzeXlFZlZrTDQzMGZuOXJyQUlOYi0yOWtTOVA5VldvX19aeXJVaHlxT21leHEtajRDX2JvNDlsZkt6ZXBPVEJ6VkQ1Y1J3WFZLMGZoZkkxYXFlVWxnT0JtNWMxdG1iUm5FSFdnV0kyTGJBN19VS0lTU19MT25RY2QzSlpfdlExbkM1Z2JaSzRMUFI5OEU3bENBWVo0NlgxTlZRMmNqZHVSQVIwM1o1ZnJZZDdvV1p0Yko2OUExNUxqOG5LcjA1QUtWNlNqQUluQmNham1jTHZuYUFycHUxMmlqazdaS1BmWTY4Sml4SHdLTjFoQVVCQ3U3ekJaMzVkVXdRX1ZNc0FlaVh2aFhpWDBZV1prd3RkMDFuREdudSIsImlzc3VlZF9hdCI6MTQxOTAxNDkyOCwidXNlcl9pZCI6IjEwMDAwMDEwOTE1ODQ2MSJ9;; _queue_session=d3B2WWNtK2hxTm53U0g2TWF0K2dadTJGZDVqb1QwcVFQVit6QkZZYU02ampKeHAyTXhGbjBPbWN6MTJjcGZLdTNqMVZ1SmRvQXByUVBGM0l2NkQ1T1hkeHpONHdtSUUrZTUxQUJPWThnYndyY1NBcHlmYndPZElqWnk2TFVNYVhoSVV2ZnUwMlRJVGhDYURaOHhJdGlZazFlWVpoak5yY0JWaVhQNy9vaXcraCtZVXFaVVdhU1ZwQTU0ekxVdWNDUEYyL0V6V1N1NmQvdXVBMzEvQ2Y3QT09LS0vaXVLRlZUc2k1dERJaWdiT2U5cGZBPT0%3D--3ff00436d0d6c2f3f1b9ce8d15b21b15201b5b09
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36

Response Headers

cache-control:max-age=0, private, must-revalidate
content-type:text/html; charset=utf-8
Date:Fri, 19 Dec 2014 18:56:22 -0600
Set-Cookie:_queue_session=TzZqeHhTK3dPUFA3c1FtQjhXdkpmcnNEZ2lFQ1lkSWFLRitBT2RxRHNyN2d0ZnlDbkVtUkd5UER3OGNsNVJKcEpFWC9VWitLK2doME0yTVB0RDFjSERCcUlhTGU4YU5WdmFGdTRvRngvMFpNeHZuNmtiYWpBck41T2xkbHNjcUJ1cG5IdVdueE8vQTRUSXhFUlIxcDYyRzlBbS9xM3hRZURmZGpGM0llT2pXVy9oU1hscFc2UTVyYm5PN3h0WEt1c2NUZmFpemdkQ1dTb0xYbE4yZzNpQT09LS1vSStsdllSc0xFaDgxdEVHS25CcDlBPT0%3D--cf70d10d8502591c6fd62bb31f8943c9855204e1;; path=/; HttpOnly
Status:200 OK
X-Powered-By:Phusion Passenger 5.0.0.beta2
x-xss-protection:1; mode=block
tonilin commented Dec 22, 2014


There is two application on my server, redmine and a rails application with devise.

It works fine on redmine

But on the other application, I faced the same problem that I can not login.


Problem is fixed now. Thanks for all the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment