shortened cookie code by dropping cookie variable; fixed type in comment