96dca3c2c0006247dc10140e29b0b7d3774ae607
[yaffs-website] / vendor / symfony / http-foundation / Tests / Session / Storage / Handler / Fixtures / storage.php
1 <?php
2
3 require __DIR__.'/common.inc';
4
5 use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
6 use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
7
8 $storage = new NativeSessionStorage();
9 $storage->setSaveHandler(new TestSessionHandler());
10 $flash = new FlashBag();
11 $storage->registerBag($flash);
12 $storage->start();
13
14 $flash->add('foo', 'bar');
15
16 print_r($flash->get('foo'));
17 echo empty($_SESSION) ? '$_SESSION is empty' : '$_SESSION is not empty';
18 echo "\n";
19
20 $storage->save();
21
22 echo empty($_SESSION) ? '$_SESSION is empty' : '$_SESSION is not empty';
23
24 ob_start(function ($buffer) { return str_replace(session_id(), 'random_session_id', $buffer); });