getCookieDomain example

public function hasSession(Request $request) {
    return $request->cookies->has($this->getName($request));
  }

  /** * {@inheritdoc} */
  public function getOptions(Request $request) {
    $options = $this->options;

    // Generate / validate the cookie domain.     $options['cookie_domain'] = $this->getCookieDomain($request) ?: '';

    // If the site is accessed via SSL, ensure that the session cookie is     // issued with the secure flag.     $options['cookie_secure'] = $request->isSecure();

    // Set the session cookie name.     $options['name'] = $this->getName($request);

    return $options;
  }

  
Home | Imprint | This part of the site doesn't use cookies.