Show / Hide login menu item not connected to node
For login add a menu item into main menu named as Login and path should be user/login.

For logout add a menu item into main menu named as logout and path should be user/logout

Now when user will be login then login menu will replaced by logout automatically. And when he/she will be logout then a login menu will appear again.