Tweet button followed by login closes window immediately after sign in


I have integrated twitter into my website. When I tweet something and have to change account or use a new account, I have the option to sign in. However, after pressing sign in the window immediately closes. Shouldn’t the window give a positive message and a close button?