# HG changeset patch # User Christian Urban # Date 1506418579 -3600 # Node ID 35ffb7a7eafaadc39e63d3a1649a08d0aada4da3 # Parent 6e08ee0d399d76afea7bfe1b9eeec9d13fc56268 fixed bug diff -r 6e08ee0d399d -r 35ffb7a7eafa handouts/ho01.pdf Binary file handouts/ho01.pdf has changed diff -r 6e08ee0d399d -r 35ffb7a7eafa progs/ap2.js --- 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 ' + diff -r 6e08ee0d399d -r 35ffb7a7eafa progs/ap3.js --- 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)); ... }); - diff -r 6e08ee0d399d -r 35ffb7a7eafa slides/slides01.pdf Binary file slides/slides01.pdf has changed