SessionConfigurationInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace Drupal\Core\Session;
  3. use Symfony\Component\HttpFoundation\Request;
  4. /**
  5. * Defines an interface for session configuration generators.
  6. */
  7. interface SessionConfigurationInterface {
  8. /**
  9. * Determines whether a session identifier is on the request.
  10. *
  11. * This method detects whether a session was started during one of the
  12. * previous requests from the same user agent. Session identifiers are
  13. * normally passed along using cookies and hence a typical implementation
  14. * checks whether the session cookie is on the request.
  15. *
  16. * @param \Symfony\Component\HttpFoundation\Request $request
  17. * The request.
  18. *
  19. * @return bool
  20. * TRUE if there is a session identifier on the request.
  21. */
  22. public function hasSession(Request $request);
  23. /**
  24. * Returns a list of options suitable for passing to the session storage.
  25. *
  26. * @see \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage::__construct()
  27. *
  28. * @param \Symfony\Component\HttpFoundation\Request $request
  29. * The request.
  30. *
  31. * @return array
  32. * An associative array of session ini settings.
  33. */
  34. public function getOptions(Request $request);
  35. }