Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion suitecrm-form-middleware/audio_captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Gregwar\Captcha\CaptchaBuilder;
use Libresign\Espeak\Espeak;

\App\Support\Http\SessionCookie::configureCrossSite();
require __DIR__ . '/session_bootstrap.php';
session_start();

header("Access-Control-Allow-Origin: {$_ENV['URL_SITE']}");
Expand Down
2 changes: 1 addition & 1 deletion suitecrm-form-middleware/captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
$builder = new CaptchaBuilder();
$builder->build();

\App\Support\Http\SessionCookie::configureCrossSite();
require __DIR__ . '/session_bootstrap.php';
session_start();

header("Access-Control-Allow-Origin: {$_ENV['URL_SITE']}");
Expand Down
12 changes: 12 additions & 0 deletions suitecrm-form-middleware/session_bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

$isHttps = (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off')
|| (($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https');

session_set_cookie_params([
'lifetime' => 0,
'path' => '/',
'secure' => $isHttps,
'httponly' => true,
'samesite' => $isHttps ? 'None' : 'Lax',
]);
2 changes: 1 addition & 1 deletion suitecrm-form-middleware/validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

include "../vendor/autoload.php";
use Gregwar\Captcha\CaptchaBuilder;
\App\Support\Http\SessionCookie::configureCrossSite();
require __DIR__ . '/session_bootstrap.php';
session_start();

header("Access-Control-Allow-Origin: {$_ENV['URL_SITE']}");
Expand Down
22 changes: 0 additions & 22 deletions support/Http/SessionCookie.php

This file was deleted.

Loading