When you do not log on to wordpress, open a webpage, which cannot be edited. Now, I log on to wordpress and refresh the page to edit it. What happened in this process? When you do not log on to wordpress, open a webpage, which cannot be edited.
Now, I log on to wordpress and refresh the page to edit it.
What happened in this process?
Reply content:
When you do not log on to wordpress, open a webpage, which cannot be edited.
Now, I log on to wordpress and refresh the page to edit it.
What happened in this process?
After you have entered the correct user name and password, the server will put an identifier in your browser. Then, when you access the server, the server will know according to this identifier! You are the one who lost the correct password !』, So we will show you the pages that can be edited.
Supplement:
Else... The first time I saw a problem, I still needed to use more terms. Okay.
What do you know about wordpress? Can you edit it?
Based on your logon status.
How does it know you have logged on?
When you log on, the login form is sent to the server program. The program extracts the user from the database and verifies the password.session
Every time you access a session, the server will know that you are a logged-on user and have the edit permission.
How does a session work?
http
The Protocol is connectionless and stateless (websocket
No) every time youRequest
One address, ServerResponse
After that, the entire http service process is over. The next time you access the service, the server does not know if you were the one you just visited. So why does the session know?
Session is a data structure maintained by the server program. It is used to differentiate successful login users. After you log on successfully, the server will putcookie
, Which recordssessionid
When you access the server again, the browser will carry the cookie to the server. Based on the sessionid, the server program will know which session is opened for you to access data for you.
It seems that the server opens a safe for each user. Although the server does not know who is going to open the cabinet, as long as he carries the key, it opens a safe for him.
What is a cookie?
Cookies are some data that the server stores in the browser during the request-response process. They are very short and small. The cookie records the domain name they are accessing. Therefore, when you access this domain name again, the cookie under this domain name will be carried to the server, the server can read the data stored in the browser.
Simply put, this is the case.
Determine whether the account can be edited Based on the logon status.
Since the landlord asked me a little details below PHP, the general cookie-based session is:
1. When a general PHP program page is opened for the first time, the server generates an identifier (session_start );
2. The server then sets it to your browser through the set-cookie in the http request, which is usually PHPSESSID;
3. When sending a request to the server again, your browser will carry the cookie information, and the server will read the session through the cookie information;
4. When logging on, the server will find your user information in the database through the user name and save it in the session;
5. After that, all other request servers can read your user information through session-session persistence;