Zend_Session-Introduction.xml 4.2 KB

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