Skip to content

Instantly share code, notes, and snippets.

@heddn
Created July 19, 2017 17:39
Show Gist options
  • Save heddn/2d30711a703031676c90770dc1240200 to your computer and use it in GitHub Desktop.
Save heddn/2d30711a703031676c90770dc1240200 to your computer and use it in GitHub Desktop.
// For anonymous users, we need to start session before storing in private
// temp store, otherwise a new session_id will be created each page view
// and the preious private store values will be inaccessible.
if ($this->currentUser->isAnonymous() && !$this->request->getSession()->get('session_started')) {
$this->request->getSession()->set('session_started', TRUE);
$this->sessionManager->start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment