-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSessionException.php
More file actions
37 lines (33 loc) · 1.14 KB
/
Copy pathSessionException.php
File metadata and controls
37 lines (33 loc) · 1.14 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
<?php
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
/**
* Italix Session - SessionException
*
* @package Italix\Session
*/
declare(strict_types=1);
namespace Italix\Session;
use RuntimeException;
/**
* Thrown when the library is asked for something it cannot honestly do.
*
* There are exactly three cases, and they are all configuration errors rather
* than runtime conditions:
*
* - a store is asked to list or revoke by subject when it cannot index
* (`can_find_by_subject() === false`) — returning an empty list instead
* would read as "one device", which is a lie the caller cannot detect;
* - a cookie is described in a way a browser would discard (`SameSite=None`
* without `Secure`, a `__Host-` name with a domain);
* - the facade is used before `begin()` or after `end()`.
*
* A missing session is **not** one of them: that is `SessionState::ABSENT`,
* which every caller must handle anyway.
*/
class SessionException extends RuntimeException
{
}