1 | <?php |
||
13 | class Handler |
||
14 | { |
||
15 | /** @var StoreInterface */ |
||
16 | private $idStore; |
||
17 | |||
18 | /** @var EntropyGeneratorInterface */ |
||
19 | private $entropyGenerator; |
||
20 | |||
21 | /** @var string Hash algo used to generate session ID (it hashes entropy). */ |
||
22 | private $hashAlgo = 'sha1'; |
||
23 | |||
24 | /** |
||
25 | * @param StoreInterface $idStore |
||
26 | */ |
||
27 | public function setIdStore(StoreInterface $idStore) |
||
31 | |||
32 | /** |
||
33 | * @return StoreInterface |
||
34 | */ |
||
35 | public function getIdStore() |
||
43 | |||
44 | /** |
||
45 | * Sets entropy that is used to generate session id. |
||
46 | * |
||
47 | * @param EntropyGeneratorInterface $entropyGenerator |
||
48 | */ |
||
49 | public function setEntropyGenerator(EntropyGeneratorInterface $entropyGenerator) |
||
53 | |||
54 | /** |
||
55 | * @return EntropyGeneratorInterface |
||
56 | */ |
||
57 | public function getEntropyGenerator() |
||
65 | |||
66 | /** |
||
67 | * @param string $algo Hash algorith accepted by hash extension. |
||
68 | * @throws Exception |
||
69 | */ |
||
70 | public function setHashAlgo($algo) |
||
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getHashAlgo() |
||
86 | |||
87 | /** |
||
88 | * @return string |
||
89 | */ |
||
90 | public function generateId() |
||
97 | |||
98 | /** |
||
99 | * @param string $id |
||
100 | */ |
||
101 | public function setId($id) |
||
105 | |||
106 | /** |
||
107 | * @return string |
||
108 | */ |
||
109 | public function getId() |
||
113 | |||
114 | /** |
||
115 | * @return bool |
||
116 | */ |
||
117 | public function issetId() |
||
121 | |||
122 | /** |
||
123 | * @return void |
||
124 | */ |
||
125 | public function unsetId() |
||
129 | } |
||
130 |