mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 07:40:39 -04:00
Add PropertyFromHttp trait and update codebase to use new pattern
This commit is contained in:
parent
c35c47b793
commit
acb30b897c
47 changed files with 851 additions and 527 deletions
|
@ -13,8 +13,8 @@ class Session{
|
|||
public DateTimeImmutable $Created;
|
||||
public string $SessionId;
|
||||
|
||||
protected ?User $_User = null;
|
||||
public ?string $_Url = null;
|
||||
protected User $_User;
|
||||
public string $_Url;
|
||||
|
||||
|
||||
// *******
|
||||
|
@ -22,7 +22,7 @@ class Session{
|
|||
// *******
|
||||
|
||||
protected function GetUrl(): string{
|
||||
if($this->_Url === null){
|
||||
if(!isset($this->_Url)){
|
||||
$this->_Url = '/sessions/' . $this->SessionId;
|
||||
}
|
||||
|
||||
|
@ -101,6 +101,11 @@ class Session{
|
|||
setcookie('sessionid', $sessionId, ['expires' => intval((new DateTimeImmutable('+1 week'))->format(Enums\DateTimeFormat::UnixTimestamp->value)), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']); // Expires in two weeks
|
||||
}
|
||||
|
||||
|
||||
// ***********
|
||||
// ORM METHODS
|
||||
// ***********
|
||||
|
||||
/**
|
||||
* @throws Exceptions\SessionNotFoundException
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue