Extract cookies correctly