Skip to content

Commit 6bb971e

Browse files
Only set cookie if result->token is not null
1 parent 9b7282a commit 6bb971e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/GateKeeper.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ public function getRedirectUrl()
204204
* Set CrowdHandler session cookie
205205
*/
206206
public function setCookie()
207-
{
208-
setcookie(self::TOKEN_COOKIE, $this->result->token, 0, '/', '', $this->debug ? false: true);
209-
$this->debug('Setting cookie '.$this->result->token);
207+
{
208+
if (!is_null($this->result->token)) {
209+
setcookie(self::TOKEN_COOKIE, $this->result->token, 0, '/', '', $this->debug ? false: true);
210+
$this->debug('Setting cookie '.$this->result->token);
211+
}
210212
}
211213

212214
/**

0 commit comments

Comments
 (0)