Prevent Ruby on Rails from sending the session header

Posted by hurikhan77 on Stack Overflow See other posts from Stack Overflow or by hurikhan77
Published on 2009-09-24T19:51:55Z Indexed on 2010/03/17 2:31 UTC
Read the original article Hit count: 425

Filed under:
|
|

How do I prevent Rails from always sending the session header (Set-Cookie). This is a security problem if the application also sends the Cache-Control: public header.

My application touches (but does not modify) the session hash in some/most actions. These pages display no private content so I want them to be cacheable - but Rails always sends the cookie header, no matter if the sent session hash is different from the previous or not.

What I want to achieve is to only send the hash if it is different from the one received from the client. How can you do that? And probably that fix should also go into official Rails release? What do you think?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about sessions