3 * @copyright Copyright (C) 2020, Friendica
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;
25 * Contains all global supported Session methods
30 * Start the current session
32 * @return self The own Session instance
34 public function start();
37 * Checks if the key exists in this session
41 * @return boolean True, if it exists
43 public function exists(string $name);
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 * Sets a single session variable.
59 * Overrides value of existing key.
64 public function set(string $name, $value);
67 * Sets multiple session variables.
68 * Overrides values for existing keys.
70 * @param array $values
72 public function setMultiple(array $values);
75 * Removes a session variable.
76 * Ignores missing keys.
80 public function remove(string $name);
83 * Clears the current session array
85 public function clear();