maxAge should be set to 0 by default, if left undefined it leads to setting maxAge to NaN.