Session Layer

A session is way of keeping track of an ongoing communication between two systems. The session layer provides a mechanism for opening, closing and managing a session between client and server.

Communication partners will sometimes want to know about each other over a longer period of time, even if the connection is interrupted.

Another need for sessions is authentication and authorization. For some network applications you will first have to authenticate to gain access to a resource, such as a private network or a network disk. The session is what ensures you don’t have to authenticate every time you make a transmission.

Note

A popular way of keeping track of sessions in web browsers is to use cookies. These are little text files that are saved in the browser and are sent as part of the HTTP headers. It is one of the ways how websites keep you authenticated when you login. It is also the mechanism that allows tracking. Facebook, for example, leaves such cookies in your web browsers when you login. They can be used to keep track of any website you visit that have a Facebook Like button, even if you don’t click them.