3 require __DIR__.'/common.inc';
5 use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
6 use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
8 $storage = new NativeSessionStorage();
9 $storage->setSaveHandler(new TestSessionHandler());
10 $flash = new FlashBag();
11 $storage->registerBag($flash);
14 $flash->add('foo', 'bar');
16 print_r($flash->get('foo'));
17 echo empty($_SESSION) ? '$_SESSION is empty' : '$_SESSION is not empty';
22 echo empty($_SESSION) ? '$_SESSION is empty' : '$_SESSION is not empty';
24 ob_start(function ($buffer) { return str_replace(session_id(), 'random_session_id', $buffer); });