Added all cookie logic.