Cisco AnyConnect VPN unable to reconnect once disconnected

I can connect to the VPN right after turning on my computer, no issues. However, if my computer goes to sleep after many hours of inactivity and the VPN disconnects automatically, I cannot reconnect again unless I restart the machine.

I get error messages saying either “Unable to contact <securevpn.my_uni.ca>” or “Another Cisco Secure Client” is running the session, even after I’ve closed every other application I had open. I am running Fedora, and I use the VPN to ssh into my university’s computers through VSCode and Filezilla.

Has your PC gone to sleep when the connection issues occur?

I suspect that the disconnection hasn’t happened properly. This is common if a machine has gone to sleep.

It looks like the process name is vpn.
You could try a ps -ef | grep -I vpn to get the process PID and then kill -9 to kill the process and then try restarting.