fix the bug of cookie