Files: e9d9dec1d00ff365112ca0f981bbda15e3682528 / test / test-79-npm / express-session / express-session.js
414 bytesRaw
1 | ; |
2 | |
3 | var session = require('express-session'); |
4 | var req = { url: '/', headers: { } }; |
5 | var res = {}; |
6 | |
7 | function genuuid () { |
8 | return 'SESSIONID'; |
9 | } |
10 | |
11 | var middleware = session({ |
12 | genid: function () { |
13 | return genuuid(); |
14 | }, |
15 | resave: false, |
16 | saveUninitialized: false, |
17 | secret: 'keyboard cat' |
18 | }); |
19 | |
20 | middleware(req, res, function () { |
21 | if (req.sessionID === 'SESSIONID') { |
22 | console.log('ok'); |
23 | } |
24 | }); |
25 |
Built with git-ssb-web