amitamb
amitamb

Reputation: 1067

How to remove Set-Cookie header from response in rails 3?

I have some actions that respond with static content. I also need them cached on client.

Similar question was asked in the past for rails 2

Is it possible to omit set-cookie header from the response in Rails 2.3?

Upvotes: 5

Views: 4115

Answers (2)

Darwin
Darwin

Reputation: 4786

Use the built in option.

env['rack.session.options'][:skip] = true
or
request.session_options[:skip] = true

or in older versions use this

env['rack.session.options'][:defer] = true
or
request.session_options[:defer] = true

You can find the documentation for it here http://rack.rubyforge.org/doc/Rack/Session/Abstract/ID.html

Upvotes: 11

Related Questions