This defect may not be in lightdm package. I was just able to reproduce it on Ubuntu 18.04.01 distribution. Here is how I did it.
I am using 18.04.01 with KDE. I installed the skypeforlinux package This package had unsatisfied dependency gnome-keyring as without it skype will not log in automatically. I installed gnome-keyring and seahorse so that I can reset the keyring. After these three I wasn't able to logout from my KDE session as I was logged back in. It didn't help to uninstall skypeforlinux or seahorse. Only after I uninstalled gnome-keyring and restarted my computer I am able to normally logout from my KDE session. On a side node now even after I log out, I can still see my session hanging around using sudo loginctl If I log in it till create second session as reported by the above command but at least I can logout reliably. ** Also affects: lightdm Importance: Undecided Status: New ** Also affects: gnome-keyring Importance: Undecided Status: New ** Also affects: skype Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to lightdm in Ubuntu. https://bugs.launchpad.net/bugs/1782510 Title: lightdm automatically logs in after logout Status in GNOME Keyring: New Status in Light Display Manager: New Status in skype: New Status in lightdm package in Ubuntu: Confirmed Bug description: Lightdm makes it impossible to logout. After I logout the lightdm logs me automatically backs in. ProblemType: Bug DistroRelease: Ubuntu 16.04 Package: lightdm 1.18.1-0ubuntu1 ProcVersionSignature: Ubuntu 4.4.0-130.156-generic 4.4.134 Uname: Linux 4.4.0-130-generic x86_64 NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia ApportVersion: 2.20.1-0ubuntu2.18 Architecture: amd64 CurrentDesktop: KDE Date: Thu Jul 19 01:18:52 2018 InstallationDate: Installed on 2016-04-26 (814 days ago) InstallationMedia: Ubuntu-Server 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.3) SourcePackage: lightdm UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/gnome-keyring/+bug/1782510/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp