At this point, the function bool Session_set_save_handler (callback open, callback close, callback read, callback write, callback destroy, CALLB ACK GC) is the solution that gives us the solution to this problem.
The 6 functions used by the function are as follows:
1. bool Open () is used to open the session storage mechanism,
2. BOOL Close () closes the session store operation.
3. Mixde read () Use this function when loading session data from storage
4. BOOL Write () writes all data for the given session ID to the store
5. bool Destroy () destroys data associated with the specified session ID
6. BOOL GC () garbage collection of data in the storage system
See the PHP manual Session_set_save_handler () function for examples.
If you use a class to process, use the
Copy the Code code as follows:
Session_set_save_handler (
Array (' ClassName ', ' open '),
Array (' ClassName ', ' close '),
Array (' ClassName ', ' read '),
Array (' ClassName ', ' write '),
Array (' ClassName ', ' destroy '),
Array (' ClassName ', ' GC '),
)
Call the 6 static methods in the ClassName class. ClassName you can swap objects without calling a static method, but using static members does not produce objects, and it performs better.
The above describes the use of Easyrecovery Professional session in PHP large Web applications, including Easyrecovery professional aspects of the content, I hope that the PHP tutorial interested in a friend helpful.