equal
deleted
inserted
replaced
4 |
4 |
5 var app = express(); |
5 var app = express(); |
6 app.use(cookie()); |
6 app.use(cookie()); |
7 |
7 |
8 app.get('/', function(req, res){ |
8 app.get('/', function(req, res){ |
9 var counter = req.cookies.counter || 0; |
9 var counter = parseInt(req.cookies.counter) || 0; |
10 res.cookie('counter', counter + 1); |
10 res.cookie('counter', counter + 1); |
11 if (counter >= 5) { |
11 if (counter >= 5) { |
12 res.write('You are a valued customer ' + |
12 res.write('You are a valued customer ' + |
13 'visting the site ' + counter + ' times.'); |
13 'visting the site ' + counter + ' times.'); |
14 } else { |
14 } else { |