changeset 174 | e2180cead443 |
parent 166 | bba0504abcf0 |
child 531 | 35ffb7a7eafa |
--- a/progs/ap2.js Tue Sep 23 17:05:33 2014 +0100 +++ b/progs/ap2.js Wed Sep 24 23:35:47 2014 +0100 @@ -5,7 +5,7 @@ app.use(cookie()); app.get('/', function(req, res){ - var counter = req.cookies.counter || 0; + var counter = parseInt(req.cookies.counter) || 0; res.cookie('counter', counter + 1); if (counter >= 5) { res.write('You are a valued customer ' +