Middleware is distributed software required to support interaction among clients and servers. In short, it is the software that is in the middle of the Client/Server systems and it acts as a bridge among the clients and servers. It starts with the API set on the client side that is used to request a service and it covers the transmission of the request over the network and the resulting response.
It neither consists of the software that gives the actual service - that is in the servers domain nor the user interface or the application login - that's in clients domain.