public function NativeSessionStorage::getId

Returns the session ID

@api

Return value

string The session ID or empty.

Overrides SessionStorageInterface::getId

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php, line 164

Class

NativeSessionStorage
This provides a base class for session attribute storage.

Namespace

Symfony\Component\HttpFoundation\Session\Storage

Code

public function getId() {
  if (!$this->started) {
    return '';

    // returning empty is consistent with session_id() behaviour
  }
  return $this->saveHandler
    ->getId();
}