SessionCacheContext::getContext

public SessionCacheContext::getContext()

File

core/lib/Drupal/Core/Cache/Context/SessionCacheContext.php, line 24

Class

SessionCacheContext
Defines the SessionCacheContext service, for "per session" caching.

Namespace

Drupal\Core\Cache\Context

Code

public function getContext() {
  $sid = $this->requestStack->getCurrentRequest()->getSession()->getId();
  return Crypt::hashBase64($sid);
}
doc_Drupal
2016-10-29 09:41:58
Comments
Leave a Comment

Please login to continue.