have had this problem for some time, and it seems to only happen with Ubuntu 18.04 (I know because I was using Debian 9 before and it didn't happen).
If I close the lid, the laptop will suspend as expected. When I open it back, it will resume with the session locked. After I unlock the session, the laptop will suspend again. Then I have to do it all over again for the laptop to function.

Do you have any idea what I can do? Which packages might be causing the problem?

I have a Lenovo G40-80 laptop, bought in 2017, using Ubuntu 18.04, fully updated. If you need any further information, I'll be glad to provide