18 $sessIdForce = $this->cfg->sessIdForce;
19 if (isset($_GET[$sessIdForce]))
20 session_id($_GET[$sessIdForce]);
21 elseif (isset($_POST[$sessIdForce]))
22 session_id($_POST[$sessIdForce]);
24 if ($this->cfg->regenerateId)
25 session_regenerate_id(
true);
29 public function get($prm) {
30 if ($this->
check($prm)) {
38 $serialize = $prm[
'serialize'];
43 return $serialize? unserialize($_SESSION[$name]) : $_SESSION[$name];
51 $prefixLn = strlen($prefix);
52 foreach($_SESSION as $k=>$v) {
53 if (strpos($k, $prefix) === 0)
54 $ret[substr($k, $prefixLn)] = $v;
59 public function set(array $prm) {
66 $_SESSION[$this->
prefixNameSpace($prm[
'name'])] = $prm[
'serialize']? serialize($prm[
'val']) : $prm[
'val'];
90 public function del($prm, $autoPrefix=
true) {
99 unset($_SESSION[$name]);
102 public function clear($nameSpace=
true) {
103 $tmp = array_keys($_SESSION);
105 if ($nameSpace ===
true)
108 if (is_string($nameSpace)) {
110 $tmp = array_filter($tmp, create_function(
'$v',
'return (strpos($v, "'.$this->
prefixNameSpace(
'').
'") === 0);'));
114 $this->
del($v,
false);
123 return $this->cfg->sessIdForce;
130 $nameSpace = $this->cfg->nameSpace? $this->cfg->nameSpace.
'_' : null;
131 return $this->cfg->prefix.$nameSpace.$name;
del($prm, $autoPrefix=true)
static initTab(array &$vars, array $init)
setNameSpaceInArray(array $prm)