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 / SessionInterface.php

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

167 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;
13
14 use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
15
16 /**
17 * Interface for the session.
18 *
19 * @author Drak <drak@zikula.org>
20 */
21 interface SessionInterface
22 {
23 /**
24 * Starts the session storage.
25 *
26 * @return bool
27 *
28 * @throws \RuntimeException if session fails to start
29 */
30 public function start();
31
32 /**
33 * Returns the session ID.
34 *
35 * @return string
36 */
37 public function getId();
38
39 /**
40 * Sets the session ID.
41 */
42 public function setId(string $id);
43
44 /**
45 * Returns the session name.
46 *
47 * @return string
48 */
49 public function getName();
50
51 /**
52 * Sets the session name.
53 */
54 public function setName(string $name);
55
56 /**
57 * Invalidates the current session.
58 *
59 * Clears all session attributes and flashes and regenerates the
60 * session and deletes the old session from persistence.
61 *
62 * @param int|null $lifetime Sets the cookie lifetime for the session cookie. A null value
63 * will leave the system settings unchanged, 0 sets the cookie
64 * to expire with browser session. Time is in seconds, and is
65 * not a Unix timestamp.
66 *
67 * @return bool
68 */
69 public function invalidate(?int $lifetime = null);
70
71 /**
72 * Migrates the current session to a new session id while maintaining all
73 * session attributes.
74 *
75 * @param bool $destroy Whether to delete the old session or leave it to garbage collection
76 * @param int|null $lifetime Sets the cookie lifetime for the session cookie. A null value
77 * will leave the system settings unchanged, 0 sets the cookie
78 * to expire with browser session. Time is in seconds, and is
79 * not a Unix timestamp.
80 *
81 * @return bool
82 */
83 public function migrate(bool $destroy = false, ?int $lifetime = null);
84
85 /**
86 * Force the session to be saved and closed.
87 *
88 * This method is generally not required for real sessions as
89 * the session will be automatically saved at the end of
90 * code execution.
91 */
92 public function save();
93
94 /**
95 * Checks if an attribute is defined.
96 *
97 * @return bool
98 */
99 public function has(string $name);
100
101 /**
102 * Returns an attribute.
103 *
104 * @param mixed $default The default value if not found
105 *
106 * @return mixed
107 */
108 public function get(string $name, $default = null);
109
110 /**
111 * Sets an attribute.
112 *
113 * @param mixed $value
114 */
115 public function set(string $name, $value);
116
117 /**
118 * Returns attributes.
119 *
120 * @return array
121 */
122 public function all();
123
124 /**
125 * Sets attributes.
126 */
127 public function replace(array $attributes);
128
129 /**
130 * Removes an attribute.
131 *
132 * @return mixed The removed value or null when it does not exist
133 */
134 public function remove(string $name);
135
136 /**
137 * Clears all attributes.
138 */
139 public function clear();
140
141 /**
142 * Checks if the session was started.
143 *
144 * @return bool
145 */
146 public function isStarted();
147
148 /**
149 * Registers a SessionBagInterface with the session.
150 */
151 public function registerBag(SessionBagInterface $bag);
152
153 /**
154 * Gets a bag instance by name.
155 *
156 * @return SessionBagInterface
157 */
158 public function getBag(string $name);
159
160 /**
161 * Gets session meta.
162 *
163 * @return MetadataBag
164 */
165 public function getMetadataBag();
166 }
167