[Ref]: Move some code to new function.
[Add]: Save cookies to avoid login frequently.