]> git.mxchange.org Git - friendica.git/blob - src/Core/Session/ISession.php
Overwrite constructor of Memory session handling so no session ini-setting in backend...
[friendica.git] / src / Core / Session / ISession.php
1 <?php
2
3 namespace Friendica\Core\Session;
4
5 /**
6  * Contains all global supported Session methods
7  */
8 interface ISession
9 {
10         /**
11          * Start the current session
12          *
13          * @return self The own Session instance
14          */
15         public function start();
16
17         /**
18          * Checks if the key exists in this session
19          *
20          * @param string $name
21          *
22          * @return boolean True, if it exists
23          */
24         public function exists(string $name);
25
26         /**
27          * Retrieves a key from the session super global or the defaults if the key is missing or the value is falsy.
28          *
29          * Handle the case where session_start() hasn't been called and the super global isn't available.
30          *
31          * @param string $name
32          * @param mixed $defaults
33          * @return mixed
34          */
35         public function get(string $name, $defaults = null);
36
37         /**
38          * Sets a single session variable.
39          * Overrides value of existing key.
40          *
41          * @param string $name
42          * @param mixed $value
43          */
44         public function set(string $name, $value);
45
46         /**
47          * Sets multiple session variables.
48          * Overrides values for existing keys.
49          *
50          * @param array $values
51          */
52         public function setMultiple(array $values);
53
54         /**
55          * Removes a session variable.
56          * Ignores missing keys.
57          *
58          * @param string $name
59          */
60         public function remove(string $name);
61
62         /**
63          * Clears the current session array
64          */
65         public function clear();
66
67         /**
68          * Kills the "Friendica" cookie and all session data
69          */
70         public function delete();
71 }