It's simplest to think in separate computer systems connected through a network.
In reality, “computer system” is mostly “a running program”, which thus talks to other programs through a network connection. Modern computer systems have no trouble running several programs at the same time, and have a network inside as well, so in practice, the above can be done on a single computer as well.
In a multi-player setup, there is one server-program that knows everything, and zero or more client programs with a keyboard and display for a user to play the game. With typical home computer systems, you thus have at most one client program due to limitations on the number of available keyboards, mice, and screens, although in a GUI environment, you could open a window for each client program obviously.
A client program doesn't know a lot, it mostly displays the game, reads keyboard etc input, and passes information between the user and the server (program). It's simplest if you see the client as a stand-alone game program, except there is no game information at the local disk, all game information must be brought in from a remote location through the network.
So how does the client work with a login? It depends on how you organize it. In its simplest form, the server needs credentials with every request that you do. The client starts with a display to log in. When the user enters the credentials, the client stores that, and sends it along to the server with every request for information, or with every action performed by the user (ie clicked at something to start a build or whatever). Eg “user X has started action Y”.
The server receives the request, verifies it, probably stores that Y is done, and returns whether or not that is approved. The client then shows the response to the user at the screen.
The first thing a client would do is query the information needed to display the game to the user.
Obviously, sending along credentials with each request eats bandwidth, and causes a lot of DB access at the server, so you may want to check once at the server, and return some ID or so that the client can use as authentication. The downside of that is that if that ID gets hi-jacked (man in-the-middle-attack), someone else could cause a lot of havoc. Likely there are other schemes that you can use, but I am not very knowledgeable in that area.