Php cannot monitor session changes on a page. how can this problem be solved?

Source: Internet
Author: User
Php cannot monitor session changes on a page. that is, if a while session is equal to the specified value, the result will be returned. However, it is not very depressing. & nbsp; is it true that when php creates a page, the session will be assigned a value, and the page must be refreshed when the session changes? yes, can the php page monitor the session changes?
That is, if I use a while session that is equal to the specified value, the result will be returned.

Is it true that when php creates a page, the session will be assigned a value. when the session changes, the page must be refreshed.

------ Solution --------------------
Yes. when the session value changes, you must refresh the page to view the new value.
But you can use AJAX to get a value from time to time, as shown in figure

JScript code
// Execute $ (document). ready (function () {function autoAlt () {// alert ("bb"); $. post ("ajax. php? Act = memo ", {act:" memo "}, function (redata) {if (redata! = "") {Alert (redata) ;}, "text")} setInterval (autoAlt, 1000 );})

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.