1 | <?php |
||
6 | class Cookie implements StoreInterface |
||
7 | { |
||
8 | /** @var string */ |
||
9 | private $id; |
||
10 | |||
11 | /** @var string Session cookie name. */ |
||
12 | private $name; |
||
13 | |||
14 | /** @var string Session cookie path */ |
||
15 | private $path; |
||
16 | |||
17 | /** @var string Session cookie domain */ |
||
18 | private $domain; |
||
19 | |||
20 | /** @var bool Should cookie be secure (SSL)? */ |
||
21 | private $secure; |
||
22 | |||
23 | /** @var bool */ |
||
24 | private $httpOnly; |
||
25 | |||
26 | /** |
||
27 | * @param string $name |
||
28 | * @param string $path |
||
29 | * @param string|null $domain |
||
30 | * @param bool $secure |
||
31 | * @param bool $httpOnly |
||
32 | */ |
||
33 | public function __construct($name = 'sid', $path = '/', $domain = null, $secure = false, $httpOnly = true) |
||
41 | |||
42 | /** |
||
43 | * @param string $id |
||
44 | */ |
||
45 | public function setId($id) |
||
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | * @throws Exception |
||
55 | */ |
||
56 | public function getId() |
||
63 | |||
64 | /** |
||
65 | * @return bool |
||
66 | */ |
||
67 | public function issetId() |
||
71 | |||
72 | /** |
||
73 | * @return void |
||
74 | */ |
||
75 | public function unsetId() |
||
79 | } |
||
80 |