with --cookies-file and check for login

@altryne thanks for the code, it works great. please let me know if any issue.