What happened after logging on to wordpress?

Source: Internet
Author: User
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.sessionEvery 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?
httpThe Protocol is connectionless and stateless (websocketNo) every time youRequestOne address, ServerResponseAfter 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 recordssessionidWhen 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;

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.