Use href rather than construct url for last cookie

fixes #2075