Tuesday, October 30, 2012

[Rails] Can't set a secure session cookie

I'm trying to set the session cookie secure flag to true. I added the
following to my environments/production.rb

ActionController::Base.session_options[:secure] = true

In the production mode I don't see the set-cookie header in the server
response (I'm using the Tamper Data Firefox tool to view the traffic). I
tried removing all cookies, manually setting the domain including the
child domain(since domain is shared among many applications, the appache
server forwards the requests to the right application and thus the
request is always received by the application server as if it's coming
from localhost). I also tried to test it in development mode, I assume
the server should at least set the cookie even if the request is over
http but the browser won't send the cookie over http but again the
server does not send the set-cookie header. Everything works just fine
if I remove that line that sets secure to true. Am I missing something
here?

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate