Skip to content

Commit

Permalink
Merge pull request #12 from redbitcz/jb-secure
Browse files Browse the repository at this point in the history
Enabler: Fix cookie in non-secure context
  • Loading branch information
jakubboucek authored Oct 19, 2021
2 parents f02098b + e318e4b commit c340d45
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Enabler.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ public function __construct(string $tempDir)
public function setSecure(bool $secure = true): self
{
$this->cookieOptions['secure'] = $secure;

if ($secure) {
$this->cookieOptions['samesite'] = 'Strict';
} elseif (isset($this->cookieOptions['samesite'])) {
unset ($this->cookieOptions['samesite']);
}

return $this;
}

Expand Down

0 comments on commit c340d45

Please sign in to comment.