fix cookie login bug