Skip to content

Commit e7fd87e

Browse files
authored
Merge pull request #53 from crowdsecurity/fix_session_handling
fix session handling with standalone library
2 parents 1f35b02 + 730bd7d commit e7fd87e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/StandAloneBounce.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class StandAloneBounce extends AbstractBounce implements IBounce
3232
public function init(array $crowdSecStandaloneBouncerConfig)
3333
{
3434
if (\PHP_SESSION_NONE === session_status()) {
35+
$this->session_name = session_name("crowdsec");
3536
session_start();
3637
}
3738
$this->settings = $crowdSecStandaloneBouncerConfig;
@@ -373,6 +374,7 @@ public function safelyBounce(): void
373374
} finally {
374375
if (\PHP_SESSION_NONE !== session_status()) {
375376
session_write_close();
377+
session_name($this->session_name);
376378
}
377379
}
378380
}

0 commit comments

Comments
 (0)