1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="zend.session.introduction">
4 <title>Introduction</title>
7 The Zend Framework Auth team greatly appreciates your feedback and contributions on our
8 email list: <ulink url="mailto:fw-auth@lists.zend.com">fw-auth@lists.zend.com</ulink>
12 With web applications written using <acronym>PHP</acronym>, a <emphasis>session</emphasis>
13 represents a logical, one-to-one connection between server-side, persistent state data and a
14 particular user agent client (e.g., web browser). <classname>Zend_Session</classname> helps
15 manage and preserve session data, a logical complement of cookie data, across multiple page
16 requests by the same client. Unlike cookie data, session data are not stored on the client
17 side and are only shared with the client when server-side source code voluntarily makes the
18 data available in response to a client request. For the purposes of this component and
19 documentation, the term "session data" refers to the server-side data stored in <ulink
20 url="http://www.php.net/manual/en/reserved.variables.php#reserved.variables.session"><varname>$_SESSION</varname></ulink>,
21 managed by <classname>Zend_Session</classname>, and individually manipulated by
22 <classname>Zend_Session_Namespace</classname> accessor objects.
23 <emphasis>Session namespaces</emphasis> provide access to session data using classic <ulink
24 url="http://en.wikipedia.org/wiki/Namespace_%28computer_science%29">namespaces</ulink>
25 implemented logically as named groups of associative arrays, keyed by strings (similar to
26 normal <acronym>PHP</acronym> arrays).
30 <classname>Zend_Session_Namespace</classname> instances are accessor objects for namespaced
31 slices of <varname>$_SESSION</varname>. The <classname>Zend_Session</classname> component
32 wraps the existing <acronym>PHP</acronym> ext/session with an administration and management
33 interface, as well as providing an <acronym>API</acronym> for
34 <classname>Zend_Session_Namespace</classname> to persist session namespaces.
35 <classname>Zend_Session_Namespace</classname> provides a standardized, object-oriented
36 interface for working with namespaces persisted inside <acronym>PHP</acronym>'s standard
37 session mechanism. Support exists for both anonymous and authenticated (e.g., "login")
38 session namespaces. <classname>Zend_Auth</classname>, the authentication component of Zend
39 Framework, uses <classname>Zend_Session_Namespace</classname> to store some information
40 associated with authenticated users. Since <classname>Zend_Session</classname> uses the
41 normal <acronym>PHP</acronym> ext/session functions internally, all the familiar
42 configuration options and settings apply (see <ulink
43 url="http://www.php.net/session">http://www.php.net/session</ulink>), with such bonuses
44 as the convenience of an object-oriented interface and default behavior that provides both
45 best practices and smooth integration with Zend Framework. Thus, a standard
46 <acronym>PHP</acronym> session identifier, whether conveyed by cookie or within
47 <acronym>URL</acronym>s, maintains the association between a client and session state data.
52 <ulink url="http://www.php.net/manual/en/function.session-set-save-handler.php">ext/session
53 save handler</ulink> does not maintain this association for server clusters under certain
54 conditions because session data are stored to the filesystem of the server that responded to
55 the request. If a request may be processed by a different server than the one where the
56 session data are located, then the responding server has no access to the session data (if
57 they are not available from a networked filesystem). A list of additional, appropriate save
58 handlers will be provided, when available. Community members are encouraged to suggest and
59 submit save handlers to the <ulink
60 url="mailto:fw-auth@lists.zend.com">fw-auth@lists.zend.com</ulink> list. A
61 <classname>Zend_Db</classname> compatible save handler has been posted to the list.