3 namespace Friendica\Security\TwoFactor\Model;
5 use Friendica\BaseEntity;
6 use Friendica\Util\DateTimeFormat;
12 * @property-read $cookie_hash
14 * @property-read $user_agent
15 * @property-read $created
16 * @property-read $last_used
17 * @package Friendica\Model\TwoFactor
19 class TrustedBrowser extends BaseEntity
21 protected $cookie_hash;
23 protected $user_agent;
28 * Please do not use this constructor directly, instead use one of the method of the TrustedBroser factory.
30 * @see \Friendica\Security\TwoFactor\Factory\TrustedBrowser
32 * @param string $cookie_hash
34 * @param string $user_agent
35 * @param string $created
36 * @param string|null $last_used
38 public function __construct(string $cookie_hash, int $uid, string $user_agent, string $created, string $last_used = null)
40 $this->cookie_hash = $cookie_hash;
42 $this->user_agent = $user_agent;
43 $this->created = $created;
44 $this->last_used = $last_used;
47 public function recordUse()
49 $this->last_used = DateTimeFormat::utcNow();