Skip to content

Commit c340d45

Browse files
authored
Merge pull request #12 from redbitcz/jb-secure
Enabler: Fix cookie in non-secure context
2 parents f02098b + e318e4b commit c340d45

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Enabler.php

+7
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ public function __construct(string $tempDir)
4545
public function setSecure(bool $secure = true): self
4646
{
4747
$this->cookieOptions['secure'] = $secure;
48+
49+
if ($secure) {
50+
$this->cookieOptions['samesite'] = 'Strict';
51+
} elseif (isset($this->cookieOptions['samesite'])) {
52+
unset ($this->cookieOptions['samesite']);
53+
}
54+
4855
return $this;
4956
}
5057

0 commit comments

Comments
 (0)