When using session technology to track a user in the system, the session is handled by default as a file in the Web server to record the session information for each user and to create a path to the session data file through Session.save_path in php.ini. This default approach, though convenient, is flawed. Can seriously affect the execution efficiency of the system. The main reason is that the session mechanism itself can not be cross-machine, because for a large number of traffic systems, usually use multiple servers for concurrent processing, if each server is processed separately, can not achieve the purpose of tracking users. At this point, you need to change the session processing mode, you can use the session information sharing technology to save to other servers, or use a database to save session information. Whether the Session information is shared using a database or sharing technology, the principle is essentially the same, with the Session_set_save_handler () function in PHP changing the default handler
1. Instructions for handling PHP custom session
Introduction: When using session technology to track users in the system, the session is handled by default as a file in the Web server to record the session information for each user, and the path to the session data file is created through Session.save_path in php.ini.
2. PHP Security-session data exposure
Summary: Session data exposure session data often contains some personal information and other sensitive data. For this reason, the exposure of session data is a matter of general concern. Generally speaking, the scope of exposure is not very large, because the session data is guaranteed ...
3. PHP Security-session data Exposure (ii)
Summary: Session data exposure when you focus on preventing source code exposure, your session data is just as risky. By default, the session is saved in the/tmp directory. This is convenient in many cases, one of which is ...
4. Analysis of the session principle in PHP and the application of large-scale web site attention
Introduction: PHP Session principle We know that the session is a way to keep user session data on the server side, and the corresponding cookie is to keep the user data on the client. HTTP protocol is a stateless protocol, the server after the response has lost the connection with the browser, the earliest, Netscape the cookie into the browser, so that the data can be client cross-page exchange, then the server is how to remember the many users of the session data? The first thing to do is to establish a one by one connection between client and server, each client has to have a unique identity, so ...
5. Application exception unknown software exception PHP multi-database supported application design 1th/2 page
Brief: Application exception unknown software exception: Application exception unknown software exception PHP multi-database supported application design 1th/2: So I think in the master-slave database design, all session-related tables should be treated with special treatment. That is: All session data tables can be updated and queried, when a user visits the site, the user is bound to the specified database, all session access and query operations on this database. The session table does not synchronize, and other non-session class updates are also updated from the primary database. This does not really escape the session update when the database switch, so if you do not want to trouble, or the session is stored in the text of the good. Sub-database design, it will be possible to improve the pressure performance of several grades
6. PHP Multi-database supported application design 1th/2 page _php Tutorial
Introduction: PHP Multi-database support for Application design page 1th/2. So I think that in the master-slave database design, all session-related tables should be treated with special treatment. That is: All session data tables can be updated and queried when a user visits a site
7. Parsing the implementation principle of the session in PHP and the problems in the application of the big website _php Tutorial
Introduction: Parsing the implementation of the session in PHP and the application of large sites should pay attention to the problem. PHP session principle We know that the session is a way to keep the user session data on the server side, and the corresponding cookie is to keep the user data on the client. The HTTP protocol is a non-stateful association
8. PHP Session and cookie_php tutorial
Introduction: PHP session with cookies. The PHP session principle session is a way to keep user session data on the server side, and the corresponding cookie is to keep the user data on the client. The HTTP protocol is a stateless protocol, and the server
9. PHP Session_encode () and Session_decode () _php Tutorials
Introduction: PHP Session_encode () and Session_decode (). This article to introduce PHP Session_encode () and Session_decode () usage, there is a need to understand the students can refer to this example. Session_encode Session_encode encode the current session data as
How PHP session Works _php Tutorial
Introduction: How the PHP session works. PHP session principle We know that the session is a way to keep the user session data on the server side, and the corresponding cookie is to keep the user data on the client. The HTTP protocol is a non-stateful association
"Related question and answer recommendation":
Java-servlet How to pass general request parameters SessionID
android-php issues with writing interface session data
Javascript-node and express development in the use of MONGODB storage session data problems, according to the book knocked, appeared the following questions, search has long been unable to find the answer, deliberately want everyone to ask
Session data is stored on the server side, if the browser is closed, the session is released?