Session function of php4 (III)

Source: Internet
Author: User
Tags php session
Php P4 session function comments (3). Read the php P4 session function comments (3). the general feeling is that the php session function can be used easily, saves a lot of trouble for processing cookies. Php session management is based on files. by default, a session file with the same name as sessionid is generated in the/tmp directory, in "> <L the general feeling is that php's session function can still be used, which is easy to use and saves a lot of processing on its own.
Cookie troubles. Php session management is based on files. the default value is in the/tmp directory.
Generate a session file with the same name as the session id. in this file, save
Session data. The session has a lifetime, which can be set in/usr/local/lib/php. ini.

Efficiency should be very sloppy. after all, file operations are still required, although it is/tmp. Great service volume
Large applications will generate many session files in/tmp...
What about distributed applications? How many web servers serve together? Here is the session file directory.
It is configurable. it is all about getting all session files to a shared nfs directory. However, php
Have you considered nfs special processing when generating a unique file? I did not go over the source code carefully.
Problems, although the probability is very small...

Instead, you can create a session keeper's damon, and the session data can be stored in a hash table.
Store the data in the memory and run the udp service (high efficiency, low loss rate in lan) to generate the session.
, Retrieval, end, and retrieval of session variables, so that multiple web servers can share
Session information. I have done both the functions on the server and the client. Now the question is how to send the client's letter
Add the number to php, or how does php support dynamic library function calling? in manual
There are no relevant examples.

BTW: due to the not strict syntax, php function return is prone to ambiguity, such as strpos, no
0 is returned for matching, but the position of matching may be 0, faint ~...



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.