Cookie
class Cookie implements AuthenticationProviderInterface, EventSubscriberInterface (View source)
Cookie based authentication provider.
Traits
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Properties
| protected TranslationInterface | $stringTranslation | The string translation service. |
from StringTranslationTrait |
| protected SessionConfigurationInterface | $sessionConfiguration | The session configuration. |
|
| protected Connection | $connection | The database connection. |
|
| protected MessengerInterface | $messenger | The messenger. |
Methods
Translates a string to the current language or to a given language.
Formats a string containing a count of items.
Returns the number of plurals supported by a given language.
Gets the string translation service.
Constructs a new cookie authentication provider.
Checks whether suitable authentication credentials are on the request.
Authenticates the user.
Returns the UserSession object for the given session.
Adds a query parameter to check successful log in redirect URL.
Registers the methods in this class that should be listeners.
Details
protected TranslatableMarkup
t(string $string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines.
In order for strings to be localized, make them available in one of the ways supported by the
protected
formatPlural($count, $singular, $plural, array $args = [], array $options = [])
Formats a string containing a count of items.
protected
getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
protected TranslationInterface
getStringTranslation()
Gets the string translation service.
$this
setStringTranslation(TranslationInterface $translation)
Sets the string translation service to use.
__construct(SessionConfigurationInterface $session_configuration, Connection $connection, MessengerInterface $messenger = NULL)
Constructs a new cookie authentication provider.
bool
applies(Request $request)
Checks whether suitable authentication credentials are on the request.
AccountInterface|null
authenticate(Request $request)
Authenticates the user.
protected AccountInterface|null
getUserFromSession(SessionInterface $session)
Returns the UserSession object for the given session.
addCheckToUrl(ResponseEvent $event)
Adds a query parameter to check successful log in redirect URL.
static array
getSubscribedEvents()
Registers the methods in this class that should be listeners.