function Cookie::applies
Same name in other branches
- 8.9.x core/modules/user/src/Authentication/Provider/Cookie.php \Drupal\user\Authentication\Provider\Cookie::applies()
- 10 core/modules/user/src/Authentication/Provider/Cookie.php \Drupal\user\Authentication\Provider\Cookie::applies()
- 11.x core/modules/user/src/Authentication/Provider/Cookie.php \Drupal\user\Authentication\Provider\Cookie::applies()
Overrides AuthenticationProviderInterface::applies
File
-
core/
modules/ user/ src/ Authentication/ Provider/ Cookie.php, line 72
Class
- Cookie
- Cookie based authentication provider.
Namespace
Drupal\user\Authentication\ProviderCode
public function applies(Request $request) {
$applies = $request->hasSession() && $this->sessionConfiguration
->hasSession($request);
if (!$applies && $request->query
->has('check_logged_in')) {
$domain = ltrim(ini_get('session.cookie_domain'), '.') ?: $request->getHttpHost();
$this->messenger
->addMessage($this->t('To log in to this site, your browser must accept cookies from the domain %domain.', [
'%domain' => $domain,
]), 'error');
}
return $applies;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.