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 the page has no action ;?, Make a checklogin. php page with no action, and automatically exit the system in 5 minutes
I want the user logging on to the system to automatically exit the system if there is no action within five minutes. How can we solve this problem?
How can I determine whether a page has no action?
------ 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" Alert ('You are not currently logged on or have timed out, please log on Again '); window. parent. location. href ='.../'; script ";
Exit;
}
------ Solution --------------------
Reference:
I want the user logging on to the system to automatically exit the system if there is no action within five minutes. How can we solve this problem?
How can I determine whether a page has no action?
So how do you determine that the user has logged on?
------ Solution --------------------
If the user is successfully logged on, put the user name in the session, and then you can check whether there is any data in the session. if not, execute the command to automatically exit the system.