ID: 37484 Updated by: [EMAIL PROTECTED] Reported By: scott at abcoa dot com -Status: Open +Status: Assigned Bug Type: Documentation problem PHP Version: Irrelevant Assigned To: ramsey
Previous Comments: ------------------------------------------------------------------------ [2006-05-18 01:28:18] [EMAIL PROTECTED] See bug #35755. I'm going to take on the task of updating the session docs to describe the different storage modules and how PHP needs to be configured in order to use the "mm" module. ------------------------------------------------------------------------ [2006-05-17 21:49:26] scott at abcoa dot com HOw come there are two related documentation on session. See one at http://www.php.net/manual/en/ref.session.php ------------------------------------------------------------------------ [2006-05-17 21:32:39] scott at abcoa dot com 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 this bug report at http://bugs.php.net/?id=37484&edit=1