Modify it in includescls_session.php
| The code is as follows: |
Copy code |
Var $ max_life_time = 1440; |
// Number in the SESSION Expiration Time and unit: seconds. The unit of this number is seconds. Both the frontend logon and background logon call the time set here.
2 rows, let the page select this item by default! The new version is a bit more secure. It takes almost five minutes to log on to the backend. Is there a way to change it because it takes only three minutes, therefore, we often time out during the input process, so we need to increase the time-out period.
The modification method is as follows:
Schemdes/init. php
Api/init. php
Admin/shortdes/init. php
Wap/shortdes/init. php
Find the following code from the above files
| The code is as follows: |
Copy code |
@ Ini_set ('session. cache_expire ', 180); // unit: Seconds |
Of course, in addition to the above method, we can also modify the php configuration file to operate it.
To continue with the Session topic in PHP, we mainly set session. gc_maxlifetime to set the Session lifecycle. For example:
| The code is as follows: |
Copy code |
<? Php Ini_set ('session. Gc_maxlifetime', 3600); // Set the time Ini_get ('session. Gc_maxlifetime'); // obtain the value set in ini. ?> |
The following provides a function encapsulated by someone else, but I have not tested it. It is for reference only:
| The code is as follows: |
Copy code |
<? Php Function start_session ($ expire = 0) { If ($ expire = 0 ){ $ Expire = ini_get ('session. Gc_maxlifetime '); } Else { Ini_set ('session. Gc_maxlifetime', $ expire ); } If (empty ($ _ COOKIE ['phpsessid ']) { Session_set_cookie_params ($ expire ); Session_start (); } Else { Session_start (); Setcookie ('phpsessid ', session_id (), time () + $ expire ); } } ?> |
Usage:
Add start_session (600); // expire after 600 seconds.