1111
1212namespace CodeIgniter \Session \Handlers ;
1313
14+ use CodeIgniter \I18n \Time ;
1415use CodeIgniter \Session \Exceptions \SessionException ;
1516use Config \App as AppConfig ;
1617use Memcached ;
@@ -167,7 +168,7 @@ public function write($id, $data): bool
167168 }
168169
169170 if (isset ($ this ->lockKey )) {
170- $ this ->memcached ->replace ($ this ->lockKey , time (), 300 );
171+ $ this ->memcached ->replace ($ this ->lockKey , Time:: now ()-> getTimestamp (), 300 );
171172
172173 if ($ this ->fingerprint !== ($ fingerprint = md5 ($ data ))) {
173174 if ($ this ->memcached ->set ($ this ->keyPrefix . $ id , $ data , $ this ->sessionExpiration )) {
@@ -245,7 +246,7 @@ public function gc($max_lifetime)
245246 protected function lockSession (string $ sessionID ): bool
246247 {
247248 if (isset ($ this ->lockKey )) {
248- return $ this ->memcached ->replace ($ this ->lockKey , time (), 300 );
249+ return $ this ->memcached ->replace ($ this ->lockKey , Time:: now ()-> getTimestamp (), 300 );
249250 }
250251
251252 $ lockKey = $ this ->keyPrefix . $ sessionID . ':lock ' ;
@@ -258,7 +259,7 @@ protected function lockSession(string $sessionID): bool
258259 continue ;
259260 }
260261
261- if (! $ this ->memcached ->set ($ lockKey , time (), 300 )) {
262+ if (! $ this ->memcached ->set ($ lockKey , Time:: now ()-> getTimestamp (), 300 )) {
262263 $ this ->logger ->error ('Session: Error while trying to obtain lock for ' . $ this ->keyPrefix . $ sessionID );
263264
264265 return false ;
0 commit comments