Create cookie in loginFactory