PluginProbe
WPIDE – File Manager & Code Editor / 3.5.9
WPIDE – File Manager & Code Editor v3.5.9
3.5.9 3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 All 55 releases
wpide / vendor / symfony / http-foundation / Session / Storage / SessionStorageInterface.php

SessionStorageInterface.php in WPIDE – File Manager & Code Editor 3.5.9, at vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php

132 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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;
13
14 use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
15
16 /**
17 * StorageInterface.
18 *
19 * @author Fabien Potencier <fabien@symfony.com>
20 * @author Drak <drak@zikula.org>
21 */
22 interface SessionStorageInterface
23 {
24 /**
25 * Starts the session.
26 *
27 * @return bool
28 *
29 * @throws \RuntimeException if something goes wrong starting the session
30 */
31 public function start();
32
33 /**
34 * Checks if the session is started.
35 *
36 * @return bool
37 */
38 public function isStarted();
39
40 /**
41 * Returns the session ID.
42 *
43 * @return string
44 */
45 public function getId();
46
47 /**
48 * Sets the session ID.
49 */
50 public function setId(string $id);
51
52 /**
53 * Returns the session name.
54 *
55 * @return string
56 */
57 public function getName();
58
59 /**
60 * Sets the session name.
61 */
62 public function setName(string $name);
63
64 /**
65 * Regenerates id that represents this storage.
66 *
67 * This method must invoke session_regenerate_id($destroy) unless
68 * this interface is used for a storage object designed for unit
69 * or functional testing where a real PHP session would interfere
70 * with testing.
71 *
72 * Note regenerate+destroy should not clear the session data in memory
73 * only delete the session data from persistent storage.
74 *
75 * Care: When regenerating the session ID no locking is involved in PHP's
76 * session design. See https://bugs.php.net/61470 for a discussion.
77 * So you must make sure the regenerated session is saved BEFORE sending the
78 * headers with the new ID. Symfony's HttpKernel offers a listener for this.
79 * See Symfony\Component\HttpKernel\EventListener\SaveSessionListener.
80 * Otherwise session data could get lost again for concurrent requests with the
81 * new ID. One result could be that you get logged out after just logging in.
82 *
83 * @param bool $destroy Destroy session when regenerating?
84 * @param int|null $lifetime Sets the cookie lifetime for the session cookie. A null value
85 * will leave the system settings unchanged, 0 sets the cookie
86 * to expire with browser session. Time is in seconds, and is
87 * not a Unix timestamp.
88 *
89 * @return bool
90 *
91 * @throws \RuntimeException If an error occurs while regenerating this storage
92 */
93 public function regenerate(bool $destroy = false, ?int $lifetime = null);
94
95 /**
96 * Force the session to be saved and closed.
97 *
98 * This method must invoke session_write_close() unless this interface is
99 * used for a storage object design for unit or functional testing where
100 * a real PHP session would interfere with testing, in which case
101 * it should actually persist the session data if required.
102 *
103 * @throws \RuntimeException if the session is saved without being started, or if the session
104 * is already closed
105 */
106 public function save();
107
108 /**
109 * Clear all session data in memory.
110 */
111 public function clear();
112
113 /**
114 * Gets a SessionBagInterface by name.
115 *
116 * @return SessionBagInterface
117 *
118 * @throws \InvalidArgumentException If the bag does not exist
119 */
120 public function getBag(string $name);
121
122 /**
123 * Registers a SessionBagInterface for use.
124 */
125 public function registerBag(SessionBagInterface $bag);
126
127 /**
128 * @return MetadataBag
129 */
130 public function getMetadataBag();
131 }
132