Skip to content
No description, website, or topics provided.
Ruby Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/rack/delete_cookies_from_public_requests. To experiment with that code, run bin/console for an interactive prompt.

TODO: Delete this and the text above, and describe your gem


Add this line to your application's Gemfile:

gem 'rack-delete_cookies_from_public_requests'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rack-delete_cookies_from_public_requests


The goal of this gem is to strip cookies from responses that are going to be cached publicly. This makes it possible to cache these pages on CDNs, and reverse proxies like varnish.


To make the middleware available in all environments, open config/application.rb and add in class Application < Rails::Application:

config.middleware.insert_before(ActionDispatch::Cookies, Rack::DeleteCookiesFromPublicRequests)

If you want to customize the environment in which the middleware is enabled edit the respective environment files instead.

You can verify the middleware positioning by typing rake middleware in the root of your application.


After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.


Bug reports and pull requests are welcome on GitHub at

You can’t perform that action at this time.