Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RedisSessionHandler.php

function RedisSessionHandler::doWrite

Overrides AbstractSessionHandler::doWrite

File

vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php, line 59

Class

RedisSessionHandler
Redis based session storage handler based on the Redis class provided by the PHP redis extension.

Namespace

Symfony\Component\HttpFoundation\Session\Storage\Handler

Code

protected function doWrite(string $sessionId, string $data) : bool {
    $ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime');
    $result = $this->redis
        ->setEx($this->prefix . $sessionId, (int) $ttl, $data);
    return $result && !$result instanceof ErrorInterface;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal