-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCookie.php
More file actions
47 lines (39 loc) · 1.18 KB
/
Cookie.php
File metadata and controls
47 lines (39 loc) · 1.18 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
<?php
/*
* This file is part of Polymorphine/Headers 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\Headers;
use Polymorphine\Headers\Cookie\Exception\CookieAlreadySentException;
use Polymorphine\Headers\Cookie\Exception\IllegalCharactersException;
interface Cookie
{
public const NAME_EXTRA_CHARS = '!\#$%&\'*+\-.^_`|~';
public const VALUE_EXTRA_CHARS = self::NAME_EXTRA_CHARS . '\/:=?\@()[\]{}<>';
/**
* @return string
*/
public function name(): string;
/**
* Sends header with server response that orders given
* value to be sent back within Cookie header in next
* requests from client.
*
* @param string $value
*
* @throws CookieAlreadySentException|IllegalCharactersException
*/
public function send(string $value): void;
/**
* Sends header with server response that orders given
* cookie to be removed on client side and not sent back
* with further requests.
*
* @throws CookieAlreadySentException
*/
public function revoke(): void;
}