This can also when you disconnect abruptly, as the server still thinks that you are logged online. The best thing to do is to restart minecraft. If that does not work, yes. Do try what jaide said.i get that when i'm logged in on a different computer and forgot about it. If you think your someone has your login info, you should change your password asap.
Snapcraft - the ultimate Minecraft experience! Join our thriving community and enjoy a diverse selection of game modes, including Factions, SkyBlock, Prison, Survival, KitPvP, and more.
Come join us now at: play.snapcraft.net
If you have questions or concerns, please feel free to reach out to us via email or submit feedback on our community forum. We're here to help!