1: <?php
2:
3: /*
4: * This file is part of the Symfony package.
5: *
6: * (c) Fabien Potencier <fabien@symfony.com>
7: *
8: * For the full copyright and license information, please view the LICENSE
9: * file that was distributed with this source code.
10: */
11:
12: namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
13:
14: /**
15: * NullSessionHandler.
16: *
17: * Can be used in unit testing or in a situations where persisted sessions are not desired.
18: *
19: * @author Drak <drak@zikula.org>
20: *
21: * @api
22: */
23: class NullSessionHandler implements \SessionHandlerInterface
24: {
25: /**
26: * {@inheritdoc}
27: */
28: public function open($savePath, $sessionName)
29: {
30: return true;
31: }
32:
33: /**
34: * {@inheritdoc}
35: */
36: public function close()
37: {
38: return true;
39: }
40:
41: /**
42: * {@inheritdoc}
43: */
44: public function read($sessionId)
45: {
46: return '';
47: }
48:
49: /**
50: * {@inheritdoc}
51: */
52: public function write($sessionId, $data)
53: {
54: return true;
55: }
56:
57: /**
58: * {@inheritdoc}
59: */
60: public function destroy($sessionId)
61: {
62: return true;
63: }
64:
65: /**
66: * {@inheritdoc}
67: */
68: public function gc($lifetime)
69: {
70: return true;
71: }
72: }
73: