class SessionCacheContext in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Cache/Context/SessionCacheContext.php \Drupal\Core\Cache\Context\SessionCacheContext
Defines the SessionCacheContext service, for "per session" caching.
Cache context ID: 'session'.
Hierarchy
- class \Drupal\Core\Cache\Context\RequestStackCacheContextBase
- class \Drupal\Core\Cache\Context\SessionCacheContext
Expanded class hierarchy of SessionCacheContext
1 string reference to 'SessionCacheContext'
- core.services.yml in core/
core.services.yml - core/core.services.yml
1 service uses SessionCacheContext
File
- core/
lib/ Drupal/ Core/ Cache/ Context/ SessionCacheContext.php, line 15 - Contains \Drupal\Core\Cache\Context\SessionCacheContext.
Namespace
Drupal\Core\Cache\ContextView source
class SessionCacheContext extends RequestStackCacheContextBase {
/**
* {@inheritdoc}
*/
public static function getLabel() {
return t('Session');
}
/**
* {@inheritdoc}
*/
public function getContext() {
return $this->requestStack
->getCurrentRequest()
->getSession()
->getId();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RequestStackCacheContextBase:: |
protected | property | The request stack. | |
RequestStackCacheContextBase:: |
public | function | Constructs a new RequestStackCacheContextBase class. | |
SessionCacheContext:: |
public | function | ||
SessionCacheContext:: |
public static | function |