-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSessionStorage.php
More file actions
63 lines (52 loc) · 1.27 KB
/
SessionStorage.php
File metadata and controls
63 lines (52 loc) · 1.27 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
<?php
/*
* This file is part of Polymorphine/Session package.
*
* (c) Shudd3r <q3.shudder@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Polymorphine\Session;
interface SessionStorage
{
public const USER_KEY = 'session.user.id';
/**
* By default an alias to SessionStorage::get('session.user.id').
*
* @return mixed User id stored within session data
*/
public function userId(): ?string;
/**
* By default an alias to SessionStorage::set('session.user.id', $value).
*
* @param string|null $userId
*/
public function newUserContext(?string $userId = null): void;
/**
* @param string $key
*
* @return bool
*/
public function has(string $key): bool;
/**
* @param string $key
* @param null $default
*
* @return mixed
*/
public function get(string $key, $default = null);
/**
* @param string $key
* @param mixed $value
*/
public function set(string $key, $value): void;
/**
* @param string $key
*/
public function remove(string $key): void;
/**
* Removes all data stored in session.
*/
public function clear(): void;
}