fixed bug
authorChristian Urban <urbanc@in.tum.de>
Tue, 26 Sep 2017 10:36:19 +0100
changeset 531 35ffb7a7eafa
parent 530 6e08ee0d399d
child 534 62985f147c85
fixed bug
handouts/ho01.pdf
progs/ap2.js
progs/ap3.js
slides/slides01.pdf
Binary file handouts/ho01.pdf has changed
--- a/progs/ap2.js	Mon Sep 25 17:16:56 2017 +0100
+++ b/progs/ap2.js	Tue Sep 26 10:36:19 2017 +0100
@@ -5,7 +5,7 @@
 app.use(cookie());
 
 app.get('/', function(req, res){
-    var counter =  parseInt(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 ' + 
--- a/progs/ap3.js	Mon Sep 25 17:16:56 2017 +0100
+++ b/progs/ap3.js	Tue Sep 26 10:36:19 2017 +0100
@@ -15,8 +15,7 @@
 }
 
 app.get('/', function(req, res){
-    var counter = gt_cookie(req.cookies.counter) || 0;
+    var counter = gt_cookie(req.cookies.counter || "") || 0;
     res.cookie('counter', mk_cookie(counter + 1));
     ...
 });
-
Binary file slides/slides01.pdf has changed