Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

Fix 3.2 session expire problem. #487

Open
wants to merge 1 commit into
base: 3.2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ThinkPHP/Common/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,10 @@ function session($name='',$value='') {
if(isset($name['name'])) session_name($name['name']);
if(isset($name['path'])) session_save_path($name['path']);
if(isset($name['domain'])) ini_set('session.cookie_domain', $name['domain']);
if(isset($name['expire'])) ini_set('session.gc_maxlifetime', $name['expire']);
if(isset($name['expire'])) {
ini_set('session.gc_maxlifetime', $name['expire']);
ini_set('session.cookie_lifetime', $name['expire']);
}
if(isset($name['use_trans_sid'])) ini_set('session.use_trans_sid', $name['use_trans_sid']?1:0);
if(isset($name['use_cookies'])) ini_set('session.use_cookies', $name['use_cookies']?1:0);
if(isset($name['cache_limiter'])) session_cache_limiter($name['cache_limiter']);
Expand Down Expand Up @@ -1455,4 +1458,4 @@ function think_filter(&$value){
if(preg_match('/^(EXP|NEQ|GT|EGT|LT|ELT|OR|LIKE|NOTLIKE|NOTBETWEEN|NOT BETWEEN|BETWEEN|NOTIN|NOT IN|IN)$/i',$value)){
$value .= ' ';
}
}
}