If you find yourself in the situation that your account is logged in and you are unable to log in again, you have what is commonly called a “ghosted avatar”, or “ghosted account”. This is a server problem: the SL servers are not releasing the account to allow log in again.
There are some things you can try to get the account logged out, but they are anecdotal and not guaranteed to work:
If none of these work, then the only other known solution is to restart the SIM on where the ghosted account is located. You may have to contact the SIM owner to have this done. For mainland SIMs, that means contacting LL Support.
More in depth suggestions are given here.
If you find that your account is being ghosted quite often, then you need to look for possible causes at your end. Ghosting often occurs due to failures to hand off your avatar data between regions. And note that this is not related to which viewer you use.
The primary suspect here is your network connection. The first thing to do is to check your real bandwidth, to ensure you have not set bandwidth too high, or too low; see here.