A rack middleware library that allows for cookies to be passed through form parameters. Specifically, it merges the specified form parameters into the Cookie header of an http request. It gets around the problem of having a flash application which interacts with a web application that uses cookie based sessions.
= Contributing
The environment can be configured by using bundler.
gem bundle or rake setup:contrib
= Usage
Rails Example:
In rails initializer
Rack::CookieMonster.configure do |c|
c.eat :_session_id
c.eat :user_credentials
c.share_with /^(Adobe|Shockwave) Flash/
c.share_with "Burt"
end
Rack::CookieMonster.configure_for_rails
Rack Example:
class CookieMonsterApplication
def call(env)
cookies = ::Rack::Request.new(env).cookies
res = ::Rack::Response.new
res.write %{
Form
Cookie 1:
Cookie 2:
Non Cookie:
#{
cookies.map do |k,v|
"
#{k} - #{v}
"
end.join("\n")
}
}
res.finish
end
end
use Rack::CookieMonster, {
:cookies => [:cookie_1, :cookie_2],
:share_with => /firefox/i
}
run CookieMonsterApplication.new
FAQs
Unknown package
We found that rack-cookie-monster demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.
Package last updated on 17 Dec 2009
Did you know?
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.
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.