Solution for ecshop background logon timeout session expiration. Many users may find that their ecshop often times out when it is used. There are many solutions to this problem. we can directly modify it in ecsho, the specific method is as follows. many users may find that their ecshop often times out when it is switched off. There are many solutions to this problem. we can directly modify them in ecsho, the procedure is as follows:
Modify it in includescls_session.php
The code is as follows: |
|
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: |
|
@ 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: |
|
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: |
|
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.
Running in...