3 namespace Drupal\Core\Cache\Context;
5 use Drupal\Component\Utility\Crypt;
8 * Defines the SessionCacheContext service, for "per session" caching.
10 * Cache context ID: 'session'.
12 class SessionCacheContext extends RequestStackCacheContextBase {
17 public static function getLabel() {
24 public function getContext() {
25 $sid = $this->requestStack->getCurrentRequest()->getSession()->getId();
26 return Crypt::hashBase64($sid);