-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathSessionManagerInterface.php
More file actions
68 lines (59 loc) · 1.67 KB
/
Copy pathSessionManagerInterface.php
File metadata and controls
68 lines (59 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
namespace Odan\Session;
use Odan\Session\Exception\SessionException;
interface SessionManagerInterface
{
/**
* Starts the session - do not use session_start().
*/
public function start(): void;
/**
* Checks if the session was started.
*
* @return bool Session status
*/
public function isStarted(): bool;
/**
* Migrates the current session to a new session id while maintaining all session attributes.
*
* Regenerates the session ID - do not use session_regenerate_id(). This method can optionally
* change the lifetime of the new cookie that will be emitted by calling this method.
*
* @throws SessionException On error
*/
public function regenerateId(): void;
/**
* Clears all session data and regenerates session ID.
*
* Do not use session_destroy().
*
* Invalidates the current session.
*
* Clears all session attributes and flashes and regenerates the session
* and deletes the old session from persistence.
*
* @throws SessionException On error
*/
public function destroy(): void;
/**
* Returns the session ID.
*
* @return string The session ID
*/
public function getId(): string;
/**
* Returns the session name.
*
* @return string The session name
*/
public function getName(): string;
/**
* Force the session to be saved and closed.
*
* This method is generally not required for real sessions as the session
* will be automatically saved at the end of code execution.
*
* @throws SessionException On error
*/
public function save(): void;
}