26 class Handler implements \SessionHandlerInterface
76 public function read($session_id)
78 $qb = $this->
db->createXoopsQueryBuilder();
80 $qb ->select(
's.session_data')
81 ->fromPrefix($this->sessionTable,
's')
82 ->where($eb->eq(
's.session_id',
':sessid'))
83 ->andWhere($eb->gt(
's.expires_at',
':expires'))
84 ->setParameter(
':sessid', $session_id, \PDO::PARAM_STR)
85 ->setParameter(
':expires', time(), \PDO::PARAM_INT);
89 if ($row =
$result->fetch(\PDO::FETCH_NUM)) {
90 list ($session_data) = $row;
95 if ((ini_get(
'session.gc_probability') == 0) && (rand(1, 100) <= 5)) {
110 public function write($session_id, $session_data)
113 ? intval(
$_SESSION[
'SESSION_MANAGER_EXPIRES'])
114 : time() + (session_cache_expire() * 60);
115 $qb = $this->
db->createXoopsQueryBuilder();
117 $qb ->updatePrefix($this->sessionTable)
118 ->set(
'expires_at',
':expires')
119 ->set(
'session_data',
':sessdata')
120 ->where($eb->eq(
'session_id',
':sessid'))
121 ->setParameter(
':sessid', $session_id, \PDO::PARAM_STR)
122 ->setParameter(
':expires',
$expires, \PDO::PARAM_INT)
123 ->setParameter(
':sessdata', $session_data, \PDO::PARAM_STR);
124 $this->
db->setForce(
true);
127 $qb = $this->
db->createXoopsQueryBuilder();
128 $qb ->insertPrefix($this->sessionTable)
130 'session_id' =>
':sessid',
131 'expires_at' =>
':expires',
132 'session_data' =>
':sessdata',
134 ->setParameter(
':sessid', $session_id, \PDO::PARAM_STR)
135 ->setParameter(
':expires',
$expires, \PDO::PARAM_INT)
136 ->setParameter(
':sessdata', $session_data, \PDO::PARAM_STR);
137 $this->
db->setForce(
true);
153 $qb = $this->
db->createXoopsQueryBuilder();
155 $qb ->deletePrefix($this->sessionTable)
156 ->where($eb->eq(
'session_id',
':sessid'))
157 ->setParameter(
':sessid', $session_id, \PDO::PARAM_STR);
158 $this->
db->setForce(
true);
159 return $qb->execute();
169 public function gc($maxlifetime)
172 $qb = $this->
db->createXoopsQueryBuilder();
174 $qb ->deletePrefix($this->sessionTable)
175 ->where($eb->lt(
'expires_at',
':expires'))
176 ->setParameter(
':expires', $mintime, \PDO::PARAM_INT);
177 $this->
db->setForce(
true);
178 return $qb->execute();
$_SESSION['RF']["verify"]
write($session_id, $session_data)
if(empty($mimetype)) $expires