3 * @copyright Copyright (C) 2010-2022, the Friendica project
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 namespace Friendica\Core\Session\Capability;
25 * Contains all global supported Session methods
27 interface IHandleSessions
30 * Start the current session
32 * @return self The own Session instance
34 public function start(): IHandleSessions;
37 * Checks if the key exists in this session
41 * @return boolean True, if it exists
43 public function exists(string $name): bool;
46 * Retrieves a key from the session super global or the defaults if the key is missing or the value is falsy.
48 * Handle the case where session_start() hasn't been called and the super global isn't available.
51 * @param mixed $defaults
55 public function get(string $name, $defaults = null);
58 * Retrieves a value from the provided key if it exists and removes it from session
61 * @param mixed $defaults
65 public function pop(string $name, $defaults = null);
68 * Sets a single session variable.
69 * Overrides value of existing key.
74 public function set(string $name, $value);
77 * Sets multiple session variables.
78 * Overrides values for existing keys.
80 * @param array $values
82 public function setMultiple(array $values);
85 * Removes a session variable.
86 * Ignores missing keys.
90 public function remove(string $name);
93 * Clears the current session array
95 public function clear();