No page Action, automatically exit the system in 5 minutes

Source: Internet
Author: User
The page has no action. after five minutes, the system automatically exits. I want the user to log on to the system. if there is no action within five minutes, the system automatically exits. How can we solve this problem?
How can I determine whether a page has no action?


Reply to discussion (solution)

Make a checklogin. php page
Inclde page in the page to determine whether the timeout exists

Session_start ();
Header ("content-type: text/html; charset = utf-8 ");
// Timeout Time. unit: Seconds. set this parameter to 10 minutes.
$ Timeout = 600;
$ Now = time ();
If ($ now-$ _ SESSION ['session _ time'])> $ timeout)
{
// Timeout.
Unset ($ _ SESSION ['clientid']);
}
Else
{
// No timeout.
$ _ SESSION ['session _ time'] = time ();
}
If (empty ($ _ SESSION ["clientID"])
{
Echo"

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.