The session layer tracks connections, also called sessions. The session layer should keep track of multiple file downloads requested by a particiular FTP application, or multiple telnet connections from a single terminal client, or web page retrievals from a web server.
The session layer performs the following functions:
- Communication with the Presentation layer above.
- Organize and manage one or more connections per application, between hosts.
- Communication with the Transport layer below.
Sessions are used to keep track of individual connections to remote servers. Your web browser is an excellent example of the use of sessions.
Your web browser (an application layer object) opens a web page. That page contains text, graphics, Macromedia Flash objects and perhaps a Java applet. The graphics, the Flash object and the Java applet are all stored as separate files on the web server. To access them, a separate download must be started. Your web browser opens a separate session to the web server to download each of the individual files. The session layer keeps track of which packets and data belong to which file and keeps track of where they go (in this case, to your web browser).
In most modern Internet applications, the session, presentation and application layers are usually rolled together inside the application itself, thus, your web browser performs all functions of the session, presentation and application layers.