fixed bug
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 23 Sep 2014 17:05:14 +0100
changeset 172 aa7ddfee35c9
parent 171 6cdf4d3906e2
child 173 9126c13a7d93
fixed bug
progs/App2.js
--- 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 ' +