Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / 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