php session trap

z老师
Release: 2020-07-31 13:51:40
Original
1126 people have browsed it

php session trap

1. Two processes cannot open a session storage handle at the same time. For example, two processes cannot perform session_start() on a session id at the same time, otherwise there is a risk of deadlock.

2. Regardless of whether there is data in the session, calling session_start() will open a storage handle, such as opening a file or establishing a connection. So don’t callsession_start()unless necessary.

3. For the storage types of memcached and redis, there is no connection pool support between requests, that is, a new connection will be created for each request.

4. The generation of session id depends on the global variable$_SERVER['REMOTE_ADDR']and the current microseconds. If the server calling session_start() or session_id() is not directly facing users, you need to pay attention to whetherREMOTE_ADDRcorrect.

Related topic recommendations:php session(including pictures, texts, videos, cases)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!