Fix wrong session expire set for custom duration

This commit is contained in:
Hypolite Petovan 2018-03-06 21:34:00 -05:00
parent f94134f556
commit ef0701a97a
4 changed files with 11 additions and 50 deletions

View file

@ -37,7 +37,7 @@ class DatabaseCacheDriver implements ICacheDriver
{
$fields = [
'v' => serialize($value),
'expires' => DateTimeFormat::utc('now + ' . Cache::duration($duration) . ' seconds'),
'expires' => DateTimeFormat::utc('now + ' . $duration . ' seconds'),
'updated' => DateTimeFormat::utcNow()
];

View file

@ -61,7 +61,7 @@ class MemcacheCacheDriver extends BaseObject implements ICacheDriver
self::getApp()->get_hostname() . ":" . $key,
serialize($value),
MEMCACHE_COMPRESSED,
Cache::duration($duration)
time() + $duration
);
}

View file

@ -52,7 +52,7 @@ class MemcachedCacheDriver extends BaseObject implements ICacheDriver
return $this->memcached->set(
self::getApp()->get_hostname() . ":" . $key,
$value,
Cache::duration($duration)
time() + $duration
);
}