In many background management systems, such a function is set to determine that the user has not performed the operation for a period of time, and then exit.
In many background management systems, such a function is set to determine that the user has not performed the operation for a period of time, and then exit.
Today, I wrote this function, and I will record it and share it with you.
1. first, set a COOKIE or SESSION value at the logon location and set its validity period. for example, if you use a COOKIE,
1
|
Setcookie ('name', $ value, $ time ); |
2. check whether the value exists at the entrance of the website. If yes, assign the same value to the variable again. if no value exists, you can jump to the logon page.
1 2 3 4 5 6 7 8 9 10 11
|
If ($ _ COOKIE ['name']) {
Setcookie ('name', $ value, $ time );
}
Else {
Header ('Location :/');
} |
This is just an example. you can refer to it and welcome your suggestions or comments.