Traditional Culture Encyclopedia - Weather inquiry - Php. After successfully setting cookies through ajax, will the client browser update cookie information? In other words, the web page does not refresh.
Php. After successfully setting cookies through ajax, will the client browser update cookie information? In other words, the web page does not refresh.
Then update the page through js at the front end.
Because the web page was downloaded when it was displayed, it will not change. If you need to change the content of the web page, you must use js to modify it, ajax to retrieve the data, and then the front end uses js to modify the page according to the data.
Your back-end deleted the cookie, but the front-end page has been parsed by the browser, so the browser will not modify the login information by itself.
Solution:
Ajax sends a request →PHP receives an exit request →PHP deletes a cookie→PHP returns a success code {"success": 1} or a failure code {"success":0}→ Front-end receives a return code → If it is 1, through js (such as document). GetElementByid ('user name'). Neller.
Generally, the exits are directly linked. After the user accesses the connection, the back end cleans the cookie, and then jumps to the original page or home page of 302 or 30 1. At present, most websites quit by jumping.
Although ajax does not refresh the page theoretically, the user experience is better, but personally, it is not necessary to use ajax for such operations as quitting the account. Usually, ajax is used for dynamically displayed data in web pages (such as weather, lottery results, activity participation information) and other data that need to be changed frequently.
- Previous article:Where have blue rainstorm warnings been issued?
- Next article:Two versions of Hong Huang's novels
- Related articles
- Weather hours in Vienna
- What should drivers pay attention to when driving in summer?
- A young man in Shanghai wanted to go out, but he was forced back by a typhoon. What should he pay attention to when traveling in typhoon weather?
- A sentence wishing others happiness forever.
- The second day of the Lunar New Year
- What month is the cold storage period in Nanjing?
- What do long-distance lovers talk about every day?
- Is it 30 degrees hot in Beijing?
- There is a place to leave a good morning message every day. Don't tell me about the ink weather. I can't find it. I want it in detail.
- What are the Cantonese lyrics agreed by Eason Chan?