cvs: /phpdoc/functions session.sgml
| From: | Sascha Schumann | Date: | Thu, 11 Nov 1999 13:12:36 +0000 |
| Subject: | cvs: /phpdoc/functions session.sgml | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-12281@lists.php.net to get a copy of this message | ||
sas Thu Nov 11 08:12:36 1999 EDT
Modified files:
/phpdoc/functions session.sgml
Log:
Correct session_name() documentation
Index: phpdoc/functions/session.sgml
diff -u phpdoc/functions/session.sgml:1.11 phpdoc/functions/session.sgml:1.12
--- phpdoc/functions/session.sgml:1.11 Fri Oct 22 04:30:14 1999
+++ phpdoc/functions/session.sgml Thu Nov 11 08:12:35 1999
@@ -315,17 +315,26 @@
<para>
<function>session_name</function> returns the name of the current
session. If <parameter>name</parameter> is specified, the name of
- the current session is changed to its value.
+ the current session is changed to its value.</para>
+ <para>
+ The session name references the session id in cookies and URLs. It should
+ contain only alphanumeric characters; it should be short and descriptive
+ (i.e. for users with enabled cookie warnings). The session name is
+ resetted to the default value stored in <literal>session.name</literal>
+ at request startup time. Thus, you need to call
+ <function>session_name</function> for every request (and before
+ <function>session_start</function> or
+ <function>session_register</function> are called).</para>
<example>
<title><function>session_name</function> examples</title>
<programlisting>
-$username="foo";
+<?php
-if(isset($username)) {
- session_name($username);
-}
+# set the session name to WebsiteID
-echo "Your username is " . session_name();
+$previous_name = session_name("WebsiteID");
+
+echo "The previous session name was $previous_name<p>";
</programlisting>
</example>
<note>