progs/App2.js
changeset 172 aa7ddfee35c9
parent 163 02026ee18378
--- a/progs/App2.js	Tue Sep 23 12:16:56 2014 +0100
+++ b/progs/App2.js	Tue Sep 23 17:05:14 2014 +0100
@@ -6,7 +6,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 ' +