sessionSettings['name']; $cookies = $request->getCookieParams(); if (!isset($cookies[$sessionCookieName])) { return $handler->handle($request); } // TODO: sessionIdentifier might be wrong, probably it should probably be storage identifier $key = new Key('session-' . $cookies[$sessionCookieName]); $lock = $this->lockFactory->createLockFromKey($key, $this->timeToLive, $this->autoRelease); $request = $request->withAttribute(static::class . '.' . static::PARAMETER_NAME, $lock); $this->logger->debug('SessionLock: Try to get "' . $key . '"'); $timedOut = \time() + $this->secondsToWait; while (!$lock->acquire()) { if (\time() >= $timedOut) { throw new LockAcquiringException( 'Could not acquire the lock for "' . $key . '" in ' . $this->secondsToWait . ' seconds.', 1652687960 ); } \usleep(100000); } $this->logger->debug('SessionLock: Acquired "' . $key . '"'); return $handler->handle($request); } }