98 if (
false === $cookieData) {
101 list(
$userId, $series, $token) = $cookieData;
106 if (isset($values[
'next_token'])) {
108 $nextToken = $values[
'next_token'];
113 $values = array(
'expires_at' => $this->now + 10,
'next_token' => $nextToken);
116 $values = array(
'expires_at' => $this->now + 2592000);
119 $cookieData = array(
$userId, $series, $nextToken);
147 if (
false !== $cookieData) {
148 list(
$userId, $series, $token) = $cookieData;
181 return isset($this->userTokens[$series]);
193 unset($this->userTokens[$series]);
206 return isset($this->userTokens[$series][$token]);
219 if (isset($this->userTokens[$series][$token])) {
220 return $this->userTokens[$series][$token];
236 $this->userTokens[$series][$token] = $values;
249 unset($this->userTokens[$series][$token]);
261 $key =
"user/{$userId}/usercookie";
262 $this->userTokens = $this->xoops->cache()->read($key);
263 if (
false === $this->userTokens) {
278 $key =
"user/{$userId}/usercookie";
279 $this->xoops->cache()->write($key, $this->userTokens, 2592000);
292 foreach ($tokens as $token => $values) {
293 if (isset($values[
'expires_at']) && $values[
'expires_at'] <
$now) {
300 if (empty($tokens)) {
312 $this->userTokens = array();
348 $cookieData = array(
$userId, $series, $token);
349 $this->
setSeriesToken($series, $token, array(
'expires_at' => $this->now + 2592000));
372 $usercookie = $this->xoops->getConfig(
'usercookie');
373 if (empty($usercookie)) {
377 $usercookie = $this->xoops->getConfig(
'usercookie');
378 $notFound =
'Nosuchcookie';
380 if ($cookieData !== $notFound) {
381 $temp = explode(
'-', $cookieData);
382 if (count(
$temp) == 3) {
401 $usercookie = $this->xoops->getConfig(
'usercookie');
402 if (empty($usercookie)) {
405 if (is_array($cookieData)) {
406 $cookieData = implode(
'-', $cookieData);
411 $secure = $httpRequest->is(
'ssl');
412 setcookie($usercookie, $cookieData, $this->now + $expire,
$path, $domain, $secure,
true);
unsetSeriesToken($series, $token)
static generateOneTimeToken($hash= 'sha512', $bytes=64)
hasSeriesToken($series, $token)
setSeriesToken($series, $token, $values)
writeUserCookie($cookieData, $expire=2592000)
static generateKey($hash= 'sha512', $bytes=128)
invalidateAllForUser($userId)
createUserCookie($userId)
static getString($name, $default= '', $hash= 'default', $mask=0)
getSeriesToken($series, $token)