sc

shared-cookies

Cookie parsing middleware for socket.io. Makes your cookies available on the request object.

Showing:

Popularity

Downloads/wk

1

GitHub Stars

0

Maintenance

Last Commit

7yrs ago

Contributors

1

Package

Dependencies

1

Size (min+gzip)

1.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Readme

shared-cookies

A cookie parsing middleware for both Express (4+) and Socket.IO (1+). This module will simplify accessing secured cookies from both Express and Socket.IO.

var app = require('express')();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
var cookies = require('shared-cookies')({ secret: 'keyboard cat' });

app.use(cookies.express);
io.use(cookies.socket);

app.get('/', function(req, res) {
  // req.cookies
});

io.on('connection', function(socket) {
  // socket.cookies
});

server.listen(3000, function() {
  debug('server listening');
});

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100