Sessions and Persistent Information

The term "session" is a technical term describing information which is remembered by an application for a particular user. Sessions work in conjunction which other mechanisms - typically cookies and user identifiers - like this:

  1. The application finds out who the user is - this information may be recorded in a cookie or be associated with a request in some other way.
  2. It then accesses a data store containing information associated different users.
  3. Finally, it accesses information specific to the stated user - this is that particular user's session.

Sessions vs. Persistent Information

Information can be said to be "persistent" when it is remembered beyond the lifetime of a particular request to an application. Sessions, meanwhile, are effectively a special case of persistent information - data is addressed or accessed using each user's identity, and the information is partitioned in such a way that sessions cannot be shared between users.

Sessions Persistent Information
Access Through user identity. Through any relevant concept: users, documents, orders, products, locations - anything an application might want to remember.
Partitioning By user identity. Each user has its own private data store. Arbitrary. Many data stores or data sources may be set up. The data may be shared across the entire application or there may be access controls in place.

Access to persistent information in general can be done in a simple fashion by using repositories (see "DirectoryRepository - Simple Access to Files in a Directory") or, for example, by using database access libraries - see "Integrating with Other Systems" for more details.

More About Sessions