Showing headers of Set Cookie instead of setting them properly

86 views
Skip to first unread message

Nathaniel Brown

unread,
Feb 20, 2009, 11:31:28 AM2/20/09
to Phusion Passenger Discussions
I just setup passenger (2.0.6) on OSX with Apache 2 and everything
works well as far as the Rails app goes, but when I try to register a
user, there is a method in resful_authentication that runs
kill_remember_cookie! which executes cookies.delete :auth_token.

When that is run, I see in the header the whole Set Cookie in plain
text rather than it actually modifying the header itself.

Set-Cookie:
_dev_session=BAh7CDoQX2NzcmZfdG9rZW4iMU9MU2x3ZUk1a0lZcnF1elVKUXZvWmNMTGpPN2xXWWRTK202dXNUSDRqNWs9Og9zZXNzaW9uX2lkIiU0YjIzNjgyOGFkOTcwMTEwMjc1OTI0MmEwMjI3NjhiDDBKmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsGOgplcnJvciJkV2UgY291bGRuJ3Qgc2V0IHVwIHRoYXQgYWNjb3VudCwgc29ycnkuICBQbGVhc2UgdHJ5IGFnYWluLCBvciBjb250YWN0IGFuIGFkbWluIChsaW5rIGlzIGFib3ZlKS4GOgpAdXNlZHsGOwhG--
f1b02ed8c33d919dfa3e81f192a78cefa329bc22; path=/; HttpOnly

It works fine when running Mongrel, but in mod_rails it seems to fail
to set the cookie. Is there some sort of setting I need to enable for
passenger to work with cookies properly?

Hongli Lai

unread,
Feb 20, 2009, 11:34:36 AM2/20/09
to phusion-...@googlegroups.com

It should work without setting anything.

Do you have a small test app with which I can reproduce the problem?

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Nathaniel Brown

unread,
Feb 20, 2009, 3:46:17 PM2/20/09
to phusion-...@googlegroups.com
Ok, so I just setup a Rails app template (new in 2.3.0). If you grab a
copy of Edge Rails and run this..

ruby vendor/rails/railties/bin/rails ~/tmp-project -m
http://gist.github.com/raw/cf0c68cacb734e56c0bb/8084113539bd1dee57714f81bd6b1e5aa29e7f85/gistfile1.rb

You will get a default app all setup and everything with the plugins
and such. Simply set it up in a virtual host in Passenger, then visit
the root url and hit submit on the signup form. You should get a Set
Cookie header in plain text on the page.

As a side note, I even tried deploying it to my Centos box as well and
that had the same problem so it doesn't seem to be local to my OSX
install.

Nathan.

Hongli Lai

unread,
Feb 20, 2009, 5:53:02 PM2/20/09
to phusion-...@googlegroups.com
On Fri, Feb 20, 2009 at 9:46 PM, Nathaniel Brown <ns...@inimit.com> wrote:
>
> Ok, so I just setup a Rails app template (new in 2.3.0). If you grab a
> copy of Edge Rails and run this..
>
> ruby vendor/rails/railties/bin/rails ~/tmp-project -m
> http://gist.github.com/raw/cf0c68cacb734e56c0bb/8084113539bd1dee57714f81bd6b1e5aa29e7f85/gistfile1.rb
>
> You will get a default app all setup and everything with the plugins
> and such. Simply set it up in a virtual host in Passenger, then visit
> the root url and hit submit on the signup form. You should get a Set
> Cookie header in plain text on the page.
>
> As a side note, I even tried deploying it to my Centos box as well and
> that had the same problem so it doesn't seem to be local to my OSX
> install.

I've confirmed that this problem is already fixed in Phusion Passenger
git master. Please use that instead.

Nathaniel Brown

unread,
Feb 20, 2009, 6:06:42 PM2/20/09
to phusion-...@googlegroups.com
Ahh sweet deal. I should be able to build the gemspec and install the
generated gem overtop of the old one? or is there a more elegant way?

Nathaniel Brown

unread,
Feb 20, 2009, 6:09:41 PM2/20/09
to phusion-...@googlegroups.com
Just seen the info on the readme at github for install via source.
Thanks for the help, I'll let you know if there are any problems.

Nathaniel Brown

unread,
Feb 20, 2009, 6:45:00 PM2/20/09
to phusion-...@googlegroups.com
I just tried installing the gem. The rake package went well, but the
command after didn't execute properly. Here is the output.

http://gist.github.com/67783

# ruby -v
ruby 1.8.5 (2006-08-25) [i386-linux]

# httpd -v
Server version: Apache/2.0.59

Lemme know what else you need to debug.

Nathan.

Nathaniel Brown

unread,
Feb 20, 2009, 6:46:49 PM2/20/09
to phusion-...@googlegroups.com
Oh, and installing it on OSX went well and did fix the problem, just
leaves the server itself.

[carbon:~] nshb% uname -a
Darwin carbon.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10
18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386

[carbon:~] nshb% ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1]

Hongli Lai

unread,
Feb 20, 2009, 7:27:47 PM2/20/09
to phusion-...@googlegroups.com
Nathaniel Brown wrote:
> I just tried installing the gem. The rake package went well, but the
> command after didn't execute properly. Here is the output.
>
> http://gist.github.com/67783
>
> # ruby -v
> ruby 1.8.5 (2006-08-25) [i386-linux]
>
> # httpd -v
> Server version: Apache/2.0.59
>
> Lemme know what else you need to debug.

Seems like a bug in the build system.

Do you have the commands apr-config and apu-config (or
apr-1-config/apu-1-config)?

What do you see if you type the following in the Passenger source directory?
irb -Ilib -rphusion_passenger/platform_info
PlatformInfo.apr_config
PlatformInfo.apu_config

Hongli Lai

unread,
Feb 20, 2009, 7:33:48 PM2/20/09
to phusion-...@googlegroups.com
I think I've fixed the build system bug. Could you pull from git master
and try again?

Nathaniel Brown

unread,
Feb 20, 2009, 7:51:50 PM2/20/09
to phusion-...@googlegroups.com
Ok so I see the new APR detections.. cool. They both fail on my
system, but worked for the previous version.

* GNU C++ compiler... found at /usr/bin/g++
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found at /usr/bin/rake
* Apache 2... found at /usr/sbin/httpd
* Apache 2 development headers... found at /usr/sbin/apxs
* fastthread... found
* Apache Portable Runtime (APR) development headers... not found
* Apache Portable Runtime Utility (APU) development headers... not found

yum search apr | grep installed

apr-devel.i386 0.9.4-24.9 installed
apr-util-devel.i386 0.9.4-22.el4 installed
apr.i386 0.9.4-24.9 installed
apr-util.i386 0.9.4-22.el4 installed

Seems I have them but the versions are not a precise match. But I
would figure it should still find them?

# irb -Ilib -rphusion_passenger/platform_info
irb(main):001:0> PlatformInfo.apr_config
=> nil
irb(main):002:0> PlatformInfo.apu_config

# apr-config --version
0.9.4
# apu-config --version
0.9.4

Hongli Lai

unread,
Feb 21, 2009, 4:57:22 AM2/21/09
to phusion-...@googlegroups.com

What is the output of:
apxs2 -q APR_CONFIG

(type 'apxs' if 'apxs2' doesn't exist)

Nathaniel Brown

unread,
Feb 21, 2009, 12:43:55 PM2/21/09
to phusion-...@googlegroups.com
# apxs -q APR_CONFIG
apxs:Error: Invalid query string `APR_CONFIG'

Hongli Lai

unread,
Feb 21, 2009, 1:49:22 PM2/21/09
to phusion-...@googlegroups.com
Nathaniel Brown wrote:
> # apxs -q APR_CONFIG
> apxs:Error: Invalid query string `APR_CONFIG'

Can you paste the contents of your config_vars.mk somewhere? You can
find the location of this file with the following command:

grep 'installbuilddir =' /path/to/apxs2

For example, on my machine, I get:

hongli@hoshino ~$ grep 'installbuilddir =' /usr/bin/apxs2
my $installbuilddir = "/usr/share/apache2/build";

My config_vars.mk is therefore /usr/share/apache2/build/config_vars.mk

Nathaniel Brown

unread,
Feb 21, 2009, 3:43:38 PM2/21/09
to phusion-...@googlegroups.com

Hongli Lai

unread,
Feb 21, 2009, 4:55:36 PM2/21/09
to phusion-...@googlegroups.com
On Sat, Feb 21, 2009 at 9:43 PM, Nathaniel Brown <ns...@inimit.com> wrote:
>
> Here you go:
>
> http://gist.github.com/68178

OK, could you pull from git master and try again?

Nathaniel Brown

unread,
Feb 21, 2009, 6:37:54 PM2/21/09
to phusion-...@googlegroups.com
Beautiful!! It works very well. Many thanks Hongli for fixing this.
Reply all
Reply to author
Forward
0 new messages