Hi all, Rails tends to send the Set-cookie:_session_id... on every response, when session handling is enabled. Is there a way to only send that header once (i.e. if the client doesnt send it in the request header)? I have a web services client that will crash on getting redundant cookies. Oh, and its wasteful too. I spent about two hours digging through the Edge Rails source, and it looks pretty buried, so I was hoping for some help. Thanks! Kyle Maxwell _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
Does the ''session'' method do what you need? http://rails.rubyonrails.org/classes/ActionController/SessionManagement/ClassMethods.html On 3/24/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote:> Hi all, > Rails tends to send the Set-cookie:_session_id... on every response, > when session handling is enabled. Is there a way to only send that > header once (i.e. if the client doesnt send it in the request header)? > I have a web services client that will crash on getting redundant > cookies. Oh, and its wasteful too. I spent about two hours digging > through the Edge Rails source, and it looks pretty buried, so I was > hoping for some help. > > Thanks! > Kyle Maxwell > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > >-- Cheers Koz
On 3/23/06, Michael Koziarski <michael@koziarski.com> wrote:> Does the 'session' method do what you need?No. I'm not looking to (selectively) disable session handling. I'm looking to keep rails from sending redundant cookies. If you are in the middle of a session, the client/browser will send you a request header like: Cookie: _session_id=3243e24982c372b341a5312 Now there is no reason for Rails to send the response header: Set-Cookie: _session_id=3243e24982c372b341a5312; path=/ The cookie is already set. Most browsers will just ignore this, but some clients will then request with: Cookie: _session_id=3243e24982c372b341a5312; _session_id=3243e24982c372b341a5312 --or-- Cookie: _session_id=3243e24982c372b341a5312 Cookie: _session_id=3243e24982c372b341a5312 Now I believe that this double request is wrong, but if we stick to the standard of only sending the session cookie once, then we don't have to worry about buggy clients. Anyhow, would like to point me in the right direction on the implementation of this, I'd appreciate it. Thanks! Kyle _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core