fix issue #101 cookieParser breaks when a page reloads

This fixes both issue #101 and issue #99.