A session layer is the 5th layer in an OSI model. This layer controls all the connections between multiple computers in a network. This layer also tracks the dialogs between these computers, which are called sessions as well. The session layer is responsible for establishing, controlling, and ending sessions between local and remote applications.
Let’s take for example the average computer user. When you open your web browser this would start a session. The session layer would establish the connection with the browser application, it would control the session and it would also end the session when you clicked on the close tab button at the top of the window. This layer would do the same if you were to click on the button to open a new tab.
When you clicked on a video file for example, that would start a new session with the video player application. The session layer, control the video player session and when the video was over it would close the session.
There can be many different sessions that the session layer would be in control of at any given time. For instance, you open your browser that would be one session, open a video that would be two, open a word document that would be three, and so on.
So basically, whatever application or applications you open, interact with, or close this layer would be responsible for making sure that the application opened properly, ran properly, and closed properly when you were done with the program. It would also record any errors that would arise if any during the session. If there were errors in the application during start up, run time, or close this layer would be the layer that would be responsible for termination of that session.