From:             scott at abcoa dot com
Operating system: 
PHP version:      Irrelevant
PHP Bug Type:     Documentation problem
Bug description:  Need a more clearer documenation on session's save_handler w/ 
shared memory.

Description:
------------
Documentation's URL: http://www.php.net/manual/en/ref.session.php

Problem: Some confusion and hard to read on the use of "mm" or shared
memory.  I discovered that there are 3 options which are "files", "mm" and
"users" to be used with the sessions.save_handler but the documentation
didn't mentioned that.  I had spend quite some time looking for more
information that would shed some lights about those.

Solution:  Update the 

--snip--
session.save_handler  string

    session.save_handler defines the name of the handler which is used for
storing and retrieving data associated with a session. Defaults to files.
See also session_set_save_handler(). 
--snip--

section to include the 3 options and explain the purpose of the 3 options.
 Example of it can be found at
http://www.zend.com/zend/tut/session.php#storage .  Good example would be


--snip--
Storage Modules
To read and save session data, PHP uses storage modules, thus abstracting
the back end of the library. There are currently three storage modules
available:

    * Files. By default, PHP uses the files module to save the session
data to disk. It creates a text file named after the session ID in /tmp.
You probably won't ever need to access this file directly. In the example
of the session counter, the content of this file would look like this,
which is a serialized representation of the variable: counter|i:4;
    * mm. If you need higher performance, the mm module is a viable
alternative; it stores the data in shared memory and is therefore not
limited by the hardware I/O system.
    * User. Used internally to realize user-level callback functions that
you define with session_set_save_handler(). 

The real power lies in the capacity to specify user callbacks as storage
modules. Because you can write your functions to handle sessions while
still being able to rely on the standardized PHP API, you can store
sessions wherever and however you want: in a database like MySQL, XML
files, on a remote FTP server (an FTP server is unlikely, but you get the
idea).
The function session_set_save_handler() takes six strings as arguments,
which must be your callback functions.

The syntax of the function is as follows:
void session_set_save_handler(string open, string close, string read,
string write, string destroy, string gc);

Tip
To leave out one argument, pass an empty string ("") to
session_set_save_handler().
--snip--

We would also need to explain that session_set_save_handler() that contain
up to 6 arguements are not the same things as setting the
session.save_handler that is either 1 of the 3 following options, "files",
"mm", and "users".  Another confusion here...

Might be a good idea to mention that compiling with the shared memory
module may be needed for "mm" option to work as specified in the
"Installation" section of this php.net's session documentation.


-- 
Edit bug report at http://bugs.php.net/?id=37484&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37484&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37484&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37484&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37484&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37484&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37484&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37484&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37484&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37484&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37484&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37484&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37484&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37484&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37484&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37484&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37484&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37484&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37484&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37484&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37484&r=mysqlcfg

Reply via email to