Skip to content

Commit

Permalink
Send header to avoid HTTP cache on session start
Browse files Browse the repository at this point in the history
  • Loading branch information
giuscris committed Dec 4, 2024
1 parent 52b27cc commit 74fbe61
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions formwork/src/Http/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Formwork\Data\Traits\DataMultipleSetter;
use Formwork\Http\Request;
use Formwork\Http\Utils\Cookie;
use Formwork\Http\Utils\Header;
use Formwork\Utils\Str;
use InvalidArgumentException;
use RuntimeException;
Expand Down Expand Up @@ -88,6 +89,8 @@ public function start(): void
'use_strict_mode' => true,
]);

Header::send('Cache-Control', 'no-store, no-cache, must-revalidate');

if (($id = session_id()) === false) {
throw new RuntimeException('Cannot get session id');
}
Expand Down

0 comments on commit 74fbe61

Please sign in to comment.