public function SessionConfiguration::hasSession in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Session/SessionConfiguration.php \Drupal\Core\Session\SessionConfiguration::hasSession()
Determines whether a session identifier is on the request.
This method detects whether a session was started during one of the previous requests from the same user agent. Session identifiers are normally passed along using cookies and hence a typical implementation checks whether the session cookie is on the request.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The request.
Return value
bool TRUE if there is a session identifier on the request.
Overrides SessionConfigurationInterface::hasSession
File
- core/
lib/ Drupal/ Core/ Session/ SessionConfiguration.php, line 36
Class
- SessionConfiguration
- Defines the default session configuration generator.
Namespace
Drupal\Core\SessionCode
public function hasSession(Request $request) {
return $request->cookies
->has($this
->getName($request));
}