Zend_Session-Introduction.xml 4.3 KB

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