SessionCacheContext.php in Zircon Profile 8.0
Same filename and directory in other branches
Namespace
Drupal\Core\Cache\ContextFile
core/lib/Drupal/Core/Cache/Context/SessionCacheContext.phpView source
<?php
/**
* @file
* Contains \Drupal\Core\Cache\Context\SessionCacheContext.
*/
namespace Drupal\Core\Cache\Context;
/**
* Defines the SessionCacheContext service, for "per session" caching.
*
* Cache context ID: 'session'.
*/
class SessionCacheContext extends RequestStackCacheContextBase {
/**
* {@inheritdoc}
*/
public static function getLabel() {
return t('Session');
}
/**
* {@inheritdoc}
*/
public function getContext() {
return $this->requestStack
->getCurrentRequest()
->getSession()
->getId();
}
}
Classes
Name | Description |
---|---|
SessionCacheContext | Defines the SessionCacheContext service, for "per session" caching. |