🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

rack-cookie_rewrite

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rack-cookie_rewrite

1.0.0
Rubygems
Version published
Maintainers
1
Created
Source

Rack::CookieRewrite

This is a Rack middleware to add extra headers which behave like the Cookie and Set-Cookie headers.

This simple middleware sets anything in the X-#{prefix}-Cookie header to Cookie, and in the response will copy anything in Set-Cookie to X-#{prefix}-Set-Cookie. This can be useful to enable session management where an HTML client is accessing your API, which doesn't fully support cookies. We have found this to be the case in some Smart TV web applications, and in mobile apps written using frameworks such as Cordova

Installation

Add this line to your application's Gemfile:

gem 'rack-cookie_rewrite'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rack-cookie_rewrite

Usage

In your config.ru, or where ever else you set up your Rack environment, add the following lines:

require 'rack/cookie_rewrite'
use Rack::CookieRewrite, 'MSP'

Then use cookies in your Rack application as normal.

In your client application, you can then use X-MSP-Cookie and X-MSP-Set-Cookie in lieu of normal Cookie commands. This means you will have to manually read and set these headers if you are sending requests that expect and set cookies.

Contributing

  • Fork it ( https://github.com/[my-github-username]/rack-cookie_rewrite/fork )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

FAQs

Package last updated on 18 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

OSZAR »