0.0.5 • Published 5 years ago

rails-cookie-parser v0.0.5

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

rails-cookie-parser

Express middleware to parse Rails session cookies. Uses node-marshal to parse Marshal strings into JavaScript objects.

Installation

npm install rails-cookie-parser

Use

Basic use

Create an external file to hold your Rails cookie secret or pass it in through the environment. The following example assumes you are passing in RAILS_COOKIE_SECRET from the environment and that your Rails session cookie is called _session.

var express = require('express');
var app = express();

/// middleware
// ...
app.use(require('cookie-parser')());
app.use(require('rails-cookie-parser')('_session', process.env.RAILS_COOKIE_SECRET));
// ...

app.use('/', function (req, res, next) {
  console.log(req.cookies['_session']); // Rails session cookie
});

Features / Limitations

rails-cookie-parser is only able to parse node-marshal's supported Marshal types.

rails-cookie-parser is not able to originate or manage Rails sessions, it is only able to read / "piggy-back" off of them.

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

8 years ago

0.0.2

9 years ago

0.0.1

9 years ago

0.0.0

10 years ago