[PHP-DEV] cvs: /phpdoc/functions session.sgml From: Sascha Schumann (sascha <email protected>)
Date: 09/11/99

sas Sat Sep 11 21:25:57 1999 EDT

  Modified files:
    /phpdoc/functions session.sgml
  Log:
  update
  
Index: phpdoc/functions/session.sgml
diff -u phpdoc/functions/session.sgml:1.4 phpdoc/functions/session.sgml:1.5
--- phpdoc/functions/session.sgml:1.4 Sat Sep 11 13:32:08 1999
+++ phpdoc/functions/session.sgml Sat Sep 11 21:25:57 1999
@@ -31,16 +31,32 @@
     Currently, objects cannot be used as session variables.
 
    <para>
- The constant <literal>SID</literal> is defined, if the session module does
- not know exactly whether the user has accepted the cookie. You can use
- <systemitem>&lt;?=SID?&gt;</systemitem> to print out the constant (this
- will evaluate to an empty string, if SID is not defined).
- <literal>SID</literal> is of the form
- <literal>session_name=session_id</literal>.
+ There are two methods to propagate a session id:
 
+ <itemizedlist>
+ <listitem><simpara>
+ Cookies
+ <listitem><simpara>
+ URL parameter
+ </itemizedlist>
+
+ <para>
+ The session module supports both methods. Cookies are optimal, but since
+ they are not reliable (clients are not bound to accept them), we cannot
+ rely on them. The second method embeds the session id directly into URLs.
+
    <para>
+ PHP is capable of doing this transparently when compiled with
+ <literal>--enable-trans-sid</literal>. If you enable this option, relative
+ URIs will be changed to contain the session id automatically.
+ Alternatively, you can use the constant <literal>SID</literal> which is
+ defined, if the client did not send the appropiate cookie.
+ <literal>SID</literal> is either of the form
+ <literal>session_name=session_id</literal> or is an empty string.
+
+ <para>
     The following example demonstrates how to register a variable, and how to
- link correctly to another page (propagation of session id).
+ link correctly to another page using SID.
   
    <example>
     <title>counting the number of hits of a single user</title>
@@ -55,12 +71,18 @@
 
 Hello visitor, you have seen this page &lt;? echo $count; ?&gt; times.&lt;p&gt;
 
+&lt;?
 # the &lt;?=SID?&gt; is necessary to preserve the session id
 # in the case that the user has disabled cookies
+?&gt;
 
 To continue, &lt;A HREF="nextpage.php?&lt;?=SID?&gt;"&gt;click here&lt;/A&gt;
 </programlisting></example>
 
+ <para>
+ The <literal>&lt;?=SID?&gt;</literal> is not necessary, if
+ <literal>--enable-trans-sid</literal> was used to compile PHP.
+
    <para>
     The session management system supports a number of configuration options
     which you can place in your php.ini file. We will give a short overview.

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>