Home > Backend Development > PHP Tutorial > What is Session

What is Session

云罗郡主
Release: 2023-04-04 14:20:01
Original
23023 people have browsed it

In the Internet, the word Session has a deep meaning. So what does Session mean? The following php Chinese website will introduce to you what a Session is.

What is Session

1: What is Session

In professional terms, Session refers to session control, which is a type of session that is stored on the server. Mechanism, when the client accesses the server, the server will record the information on the server in some form, which is exactly the opposite of Cookie.

2: What is the working principle of session

What is Session

When the client makes a request to the server , the server will save a session. When the session is enabled for the first time, a cookie file is also formed on the client. The session_start() function is used for the first time, and PHP loads the stored session variables and registers the variables through the function. , when the script is executed, it will be automatically saved in the session library for easy use next time.

3: How to use Session

Session is often used to ensure a certain state of information during the session. For example, when users log in, they need to browse web applications. , and the storage is when the page is reloaded, the Session can always be accessed on the device at any time, but as the number of users increases, the Session's server memory will continue to increase, and the Session will also use persistence methods. limit.

Four: What are the characteristics of Session

Session is not thread-safe, and the creation and deletion of Session consumes too many resources, and each Session instance will have own cache.

The above is a complete introduction to what Session is. If you want to know more about php getting started, please pay attention to the php Chinese website.


The above is the detailed content of What is Session. For more information, please follow other related articles on the PHP Chinese website!

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template