The project encountered a strange problem when using Ajax. After the Administrator logged on to the system, he managed his account and changed his password, after he leaves the system, he finds that he cannot log on with the new password, but he can only log on with the original password. Where is the problem?
PassCodeCheck. I found that the problem occurred when I used the get method when sending the request. It was normal after I changed it to post. What is the difference between get and post?
When the get method is used, the browser attaches each form field element and its data to the resource path in the request line according to the URL parameter format. There is a limit on the amount of data transmitted by parameters in the get method, it is generally limited to 1 kb. The most important thing is that it will be cached by the client's browser, so that others can read the customer's data from the browser's historical records, for example, account and password. Therefore, in some cases, the get method may cause serious security problems.
When the POST method is used, the browser sends the form field elements and their data to the Web server as the entity content of the HTTP message, rather than as the URL address parameter, the amount of data transmitted in post mode is much larger than that transmitted in get mode.
In short, the get method delivers a small amount of data, high processing efficiency, low security, and will be cached, whereas the POST method does not.
--------------------------------------------------
TIPS: To avoid caching, you can add a timestamp parameter after the request.