Skip to content

Commit

Permalink
改进session函数 删除操作支持数组
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Sep 1, 2014
1 parent 17379e7 commit 93e2712
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ThinkPHP/Common/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1247,10 +1247,11 @@ function session($name='',$value='') {
}
}
}elseif(is_null($value)){ // 删除session
if($prefix){
unset($_SESSION[$prefix][$name]);
if(strpos($name,'.')){
list($name1,$name2) = explode('.',$name);
$prefix ? unset($_SESSION[$prefix][$name1][$name2]) : unset($_SESSION[$name1][$name2]);
}else{
unset($_SESSION[$name]);
$prefix ? unset($_SESSION[$prefix][$name]) : unset($_SESSION[$name]);
}
}else{ // 设置session
if($prefix){
Expand Down

0 comments on commit 93e2712

Please sign in to comment.