Session (computer Science) - Client Side Web Sessions

Client Side Web Sessions

Client-side sessions use cookies and cryptographic techniques to maintain state without storing as much data on the server. When presenting a dynamic web page, the server sends the current state data to the client (web browser) in the form of a cookie. The client saves the cookie in memory or on disk. With each successive request, the client sends the cookie back to the server, and the server uses the data to "remember" the state of the application for that specific client and generate an appropriate response.

This mechanism may work well in some contexts; however, data stored on the client is vulnerable to tampering by the user or by software that has access to the client computer. To use client-side sessions where confidentiality and integrity are required, the following must be guaranteed:

  1. Confidentiality: Nothing apart from the server should be able to interpret session data.
  2. Data integrity: Nothing apart from the server should manipulate session data (accidentally or maliciously).
  3. Authenticity: Nothing apart from the server should be able to initiate valid sessions.

To accomplish this, the server needs to encrypt the session data before sending it to the client, and modification of such information by any other party should be prevented via cryptographic means.

Transmitting state back and forth with every request is only practical when the size of the cookie is small. In essence, client-side sessions trade server disk space for the extra bandwidth that each web request will require. Moreover, web browsers limit the number and size of cookies that may be stored by a web site. To improve efficiency and allow for more session data, the server may compress the data before creating the cookie, decompressing it later when the cookie is returned by the client.

Read more about this topic:  Session (computer Science)

Famous quotes containing the words client, side and/or web:

    A client is to me a mere unit, a factor in a problem.
    Sir Arthur Conan Doyle (1859–1930)

    The pork sizzles and cries for fish. Luckily for the foolish race, and this particularly foolish generation of trout, the night shut down at last, not a little deepened by the dark side of Ktaadn, which, like a permanent shadow, reared itself from the eastern bank.
    Henry David Thoreau (1817–1862)

    Being so wrong about her makes me wonder now how often I am utterly wrong about myself. And how wrong she might have been about her mother, how wrong he might have been about his father, how much of family life is a vast web of misunderstandings, a tinted and touched-up family portrait, an accurate representation of fact that leaves out only the essential truth.
    Anna Quindlen (b. 1952)