Skip to content

Instantly share code, notes, and snippets.

@cranberyxl
Created February 16, 2011 21:58
Show Gist options
  • Save cranberyxl/830331 to your computer and use it in GitHub Desktop.
Save cranberyxl/830331 to your computer and use it in GitHub Desktop.
Use sessions across client requests
<?php
class YourTestKernel extends \yourKernel
{
protected $session;
protected function initializeContainer()
{
parent::initializeContainer();
// first use
if ($this->session === null) {
$this->session = $this->container->get('session');
} else {
$this->container->set('session', $this->session);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment