krakenjs / lusca

Application security for express apps.
Other
1.79k stars 122 forks source link

Express 4.* compatibility #24

Closed ninjatux closed 10 years ago

ninjatux commented 10 years ago

Hi all, i'm building an express 4.* application and I there are some incompatibilities with lusca due the changes made in the framework.

I've noticed that for using the csrf functionality you need to do the following changes to the express app:

var express = require('express'),
    session = require('express-session'),
    lusca = require('lusca'),
    app = express();

app.use(session({secret: 'my secret', key: 'sid', cookie: {secure: true}}));
app.use(lusca.csrf());

Can we update the readme to provide also infos about express 4.* compatibility?