cvs: /phpdoc/functions session.sgml
| From: | Sascha Schumann | Date: | Sun, 12 Sep 1999 01:25:57 +0000 |
| Subject: | cvs: /phpdoc/functions session.sgml | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10820@lists.php.net to get a copy of this message | ||
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><?=SID?></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 <? echo $count; ?> times.<p>
+<?
# the <?=SID?> is necessary to preserve the session id
# in the case that the user has disabled cookies
+?>
To continue, <A HREF="nextpage.php?<?=SID?>">click
here</A>
</programlisting></example>
+ <para>
+ The <literal><?=SID?></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.