In general, I feel that the session function of php can basically be used, it is quite convenient, and it saves a lot of trouble of handling cookies by yourself. PHP's session management is still based on files. The default is to generate a session file with the same name as the session id in the /tmp directory, and save the registered session data in this file. Session has a lifetime, which can be set in /usr/local/lib/php.ini.
The efficiency should be considered so-so. After all, file operations are still required, although it is /tmp. For applications with a large service volume, many session files will be generated in /tmp. . .
What about distributed applications? How many web servers serve together? There is a trick, the directory of session files is configurable, just put all session files into a shared nfs directory and you're done. But when php
generates unique files, have you considered the special processing of nfs? I didn't look at the source code carefully, so I guess something might go wrong, although the chance is very small... But I can be a session keeper damon. The session data can be stored in the memory in the form of a hash table, using the udp service method ( High efficiency, small packet loss rate in LAN) completes session generation, retrieval, end, access and setting of session variables, etc., so that multiple web servers can share session information. I have done both server-side and client-side functions. Now the question is how to add client-side functions to PHP, or how PHP supports dynamic library function calls. These things are not detailed in the manual. Relevant examples.
BTW: Due to the loose grammar, PHP function returns are prone to ambiguity, such as strpos, no
matching returns 0, but the matching position may be 0, favorite~...
The above has introduced the session function review (3) of easyrecoveryprofessional php4, including the content of easyrecoveryprofessional. I hope it will be helpful to friends who are interested in PHP tutorials.