This is a common symptom of mis behaviour of systemd-logind. I couldn’t still find-out what is really happening underneath of this service but if you experience such issues you can try to restart the service using following command
sudo service systemd-logind restart
and make sure to run this code on the console not just by using ssh.
If anyone knows more about underlying components of systemd-logind please give me some more information about it.