Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion Helper/DeviceView.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class DeviceView
const COOKIE_DOMAIN_DEFAULT = '';
const COOKIE_SECURE_DEFAULT = false;
const COOKIE_HTTP_ONLY_DEFAULT = true;
const COOKIE_RAW_DEFAULT = false;
const COOKIE_SAMESITE_DEFAULT = null;
const COOKIE_EXPIRE_DATETIME_MODIFIER_DEFAULT = '1 month';
const SWITCH_PARAM_DEFAULT = 'device_view';

Expand Down Expand Up @@ -75,6 +77,16 @@ class DeviceView
* @var bool
*/
protected $cookieHttpOnly = self::COOKIE_HTTP_ONLY_DEFAULT;

/**
* @var bool
*/
protected $cookieRaw = self::COOKIE_RAW_DEFAULT;

/**
* @var string|null
*/
protected $cookieSamesite = self::COOKIE_SAMESITE_DEFAULT;

/**
* @var string
Expand Down Expand Up @@ -415,6 +427,46 @@ public function setCookieHttpOnly($cookieHttpOnly)
$this->cookieHttpOnly = $cookieHttpOnly;
}

/**
* Is the cookie raw.
*
* @return bool
*/
public function isCookieRaw()
{
return $this->cookieRaw;
}

/**
* Setter of CookieRaw.
*
* @param bool $cookieRaw
*/
public function setCookieRaw($cookieRaw)
{
$this->cookieRaw = $cookieRaw;
}

/**
* Getter of CookieSamesite.
*
* @return string|null
*/
public function getCookieSamesite()
{
return $this->cookieSamesite;
}

/**
* Setter of CookieSamesite.
*
* @param string|null $cookieSamesite
*/
public function setCookieSamesite($cookieSamesite)
{
$this->cookieSamesite = $cookieSamesite;
}

/**
* Setter of SwitchParam.
*
Expand Down Expand Up @@ -473,7 +525,9 @@ protected function createCookie($value)
$this->getCookiePath(),
$this->getCookieDomain(),
$this->isCookieSecure(),
$this->isCookieHttpOnly()
$this->isCookieHttpOnly(),
$this->isCookieRaw(),
$this->getCookieSamesite()
);
}

Expand Down