Fixed cookie handling