WebStack

Annotated docs/sessions.html

503:5e29854fe10d
2005-11-15 paulb [project @ 2005-11-15 15:46:01 by paulb] Added has_key method.
paulb@360 1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
paulb@360 2
<html xmlns="http://www.w3.org/1999/xhtml">
paulb@360 3
<head>
paulb@360 4
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type" />
paulb@360 5
  <title>Sessions and Persistent Information</title>
paulb@360 6
  <meta name="generator"
paulb@360 7
 content="amaya 8.1a, see http://www.w3.org/Amaya/" />
paulb@360 8
  <link href="styles.css" rel="stylesheet" type="text/css" />
paulb@360 9
</head>
paulb@360 10
<body>
paulb@360 11
<h1>Sessions and Persistent Information</h1>
paulb@360 12
<p>The term "session" is a technical term describing information which
paulb@360 13
is remembered by an application for a particular user. Sessions work in
paulb@360 14
conjunction which other mechanisms - typically <a href="cookies.html">cookies</a>
paulb@360 15
and <a href="users.html">user identifiers</a> - like this:</p>
paulb@360 16
<ol>
paulb@360 17
  <li> The application finds out who the user is - this information may
paulb@360 18
be recorded in a <a href="cookies.html">cookie</a> or be associated
paulb@360 19
with a request in <a href="users.html">some other way</a>.</li>
paulb@360 20
  <li>It then accesses a data store containing information associated
paulb@360 21
different users.</li>
paulb@360 22
  <li>Finally, it accesses information specific to the stated user -
paulb@360 23
this is&nbsp;that particular user's session.</li>
paulb@360 24
</ol>
paulb@360 25
<h2>Sessions vs. Persistent Information</h2>
paulb@360 26
<p>Information can be said to be "persistent" when&nbsp;it is
paulb@360 27
remembered beyond the lifetime of a particular request to an
paulb@360 28
application. Sessions, meanwhile, are effectively a special case of
paulb@360 29
persistent information - data is addressed or accessed using each
paulb@360 30
user's identity, and the information is partitioned in such a way that
paulb@360 31
sessions cannot be shared between users.</p>
paulb@360 32
<table style="text-align: left; width: 80%;" align="center" border="1"
paulb@360 33
 cellpadding="5" cellspacing="0" width="80%">
paulb@360 34
  <tbody>
paulb@360 35
    <tr>
paulb@360 36
      <td></td>
paulb@360 37
      <th style="text-align: center;">Sessions</th>
paulb@360 38
      <th style="text-align: center;">Persistent Information</th>
paulb@360 39
    </tr>
paulb@360 40
    <tr>
paulb@360 41
      <th>Access</th>
paulb@360 42
      <td align="undefined" valign="undefined">Through user identity.</td>
paulb@360 43
      <td align="undefined" valign="undefined">Through any relevant
paulb@360 44
concept: users, documents, orders, products, locations - anything an
paulb@360 45
application might want to remember.</td>
paulb@360 46
    </tr>
paulb@360 47
    <tr>
paulb@360 48
      <th>Partitioning</th>
paulb@360 49
      <td align="undefined" valign="undefined">By user identity. Each
paulb@360 50
user has its own private data store.</td>
paulb@360 51
      <td align="undefined" valign="undefined">Arbitrary. Many data
paulb@360 52
stores or data sources may be set up. The data may be shared across the
paulb@360 53
entire application or there may be access controls in place.</td>
paulb@360 54
    </tr>
paulb@360 55
  </tbody>
paulb@360 56
</table>
paulb@360 57
<p>Access to persistent information in general can be done by using
paulb@360 58
database access libraries, for example - see <a href="integrating.html">"Integrating
paulb@360 59
with Other Systems"</a> for more details. </p>
paulb@360 60
<h2>More About Sessions</h2>
paulb@360 61
<ul>
paulb@360 62
  <li><a href="sessions-usage.html">Using Sessions</a></li>
paulb@360 63
  <li><a href="sessions-servers.html">Server Environment Support for
paulb@360 64
Sessions</a></li>
paulb@360 65
</ul>
paulb@360 66
</body>
paulb@360 67
</html>