forked from nette/security
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserStorage.php
More file actions
44 lines (35 loc) · 929 Bytes
/
Copy pathUserStorage.php
File metadata and controls
44 lines (35 loc) · 929 Bytes
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
<?php
/**
* This file is part of the Nette Framework (https://nette.org)
* Copyright (c) 2004 David Grudl (https://davidgrudl.com)
*/
declare(strict_types=1);
namespace Nette\Security;
/**
* Interface for persistent storage for user object data.
*/
interface UserStorage
{
/** Log-out reason */
public const
LOGOUT_MANUAL = 1,
LOGOUT_INACTIVITY = 2;
/**
* Sets the authenticated state of user.
*/
function saveAuthentication(IIdentity $identity): void;
/**
* Removed authenticated state of user.
*/
function clearAuthentication(bool $clearIdentity): void;
/**
* Returns user authenticated state, identity and logout reason.
* @return array{bool, ?IIdentity, ?int}
*/
function getState(): array;
/**
* Enables log out from the persistent storage after inactivity (like '20 minutes').
* @param string|int|null $expire
*/
function setExpiration($expire, bool $clearIdentity): void;
}