|
@@ 143-155 (lines=13) @@
|
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
|
| 143 |
|
private function checkCookieExpireTime(Entity\CookieIdentity $identity) |
| 144 |
|
{ |
| 145 |
|
if ($identity->getExpiresOn() < time()) { |
| 146 |
|
$identity->setStatus(Entity\Identity::STATUS_EXPIRED); |
| 147 |
|
|
| 148 |
|
$this->logger->info('cookie expired', $this->assembleCookieLogDetails($identity)); |
| 149 |
|
|
| 150 |
|
$mapper = $this->mapperFactory->create(Mapper\CookieIdentity::class); |
| 151 |
|
$mapper->store($identity); |
| 152 |
|
|
| 153 |
|
throw new IdentityExpired; |
| 154 |
|
} |
| 155 |
|
} |
| 156 |
|
|
| 157 |
|
|
| 158 |
|
/** |
|
@@ 165-179 (lines=15) @@
|
| 162 |
|
* @param string $key |
| 163 |
|
* @throws \Palladium\Exception\CompromisedCookie if key does not match |
| 164 |
|
*/ |
| 165 |
|
private function checkCookieKey(Entity\CookieIdentity $identity, $key) |
| 166 |
|
{ |
| 167 |
|
if ($identity->matchKey($key) === true) { |
| 168 |
|
return; |
| 169 |
|
} |
| 170 |
|
|
| 171 |
|
$identity->setStatus(Entity\Identity::STATUS_BLOCKED); |
| 172 |
|
|
| 173 |
|
$mapper = $this->mapperFactory->create(Mapper\CookieIdentity::class); |
| 174 |
|
$mapper->store($identity); |
| 175 |
|
|
| 176 |
|
$this->logger->warning('compromised cookie', $this->assembleCookieLogDetails($identity)); |
| 177 |
|
|
| 178 |
|
throw new CompromisedCookie; |
| 179 |
|
} |
| 180 |
|
|
| 181 |
|
|
| 182 |
|
/** |