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