r=self adding changes for cookie handler