Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rack-auth-cookie

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rack-auth-cookie

  • 0.7.6
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

= Description The rack-cookie library is a Rack library that uses a cookie as a token to authenticate requests from users that have authenticated earlier using some other method.

= Prerequisites rack 1.0.0 or later

= Usage use "Rack::Auth::Cookie", :secret => "foo", :cookie_name => "my_authentication_cookie"

= Default Fields The default value for cookie_name is "auth_token"

= Details The "secret" option works exactly as in Rails session cookies. This should be set to a hard-to-guess value (not "foo"!) to protect against cookie forgery.

This rack library only handles requests that contain a cookie named "auth_token" (or whatever name was passed as the :cookie_name option). If that is not present, the request is forwarded normally with no changes to the environment.

If the cookie is detected, then it is checked for validity. If valid, then the values stored in the cookie (such as 'AUTH_USER') are copied from the cookie into the environment. If invalid, then env['AUTH_USER'] is deleted and env['AUTH_FAIL'] is set to an error message explaining what went wrong.

Note that if env['AUTH_USER'] or env['AUTH_FAIL'] are already set, then the request is forwarded normally with no changes to the environment.

= Authors Daniel Berger Charlie O'Keefe

FAQs

Package last updated on 23 Nov 2010

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc