A socket is a combination of an IP address and a port number that identifies a unique endpoint in a network. A session refers to the logical connection established between two endpoints for the purpose of exchanging data.
In other words, a socket is the address of a network resource, while a session is a connection between two sockets that allows data to be exchanged.