No commit activity in last 3 years
No release in over 3 years
This is particularly useful in case of varnish caches, preventing them from logging you in as a random person.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.11
~> 10.0
~> 3.0
 Project Readme

Rack::DeleteCookiesFromPublicRequests

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

Installation

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

Concept

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.

Usage

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.

Development

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.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/gja/rack-delete_cookies_from_public_requests.