diff --git a/suitecrm-form-middleware/audio_captcha.php b/suitecrm-form-middleware/audio_captcha.php index fae85c56..533fc322 100644 --- a/suitecrm-form-middleware/audio_captcha.php +++ b/suitecrm-form-middleware/audio_captcha.php @@ -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']}"); diff --git a/suitecrm-form-middleware/captcha.php b/suitecrm-form-middleware/captcha.php index 98f78103..5ee0007a 100644 --- a/suitecrm-form-middleware/captcha.php +++ b/suitecrm-form-middleware/captcha.php @@ -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']}"); diff --git a/suitecrm-form-middleware/session_bootstrap.php b/suitecrm-form-middleware/session_bootstrap.php new file mode 100644 index 00000000..d4512ae2 --- /dev/null +++ b/suitecrm-form-middleware/session_bootstrap.php @@ -0,0 +1,12 @@ + 0, + 'path' => '/', + 'secure' => $isHttps, + 'httponly' => true, + 'samesite' => $isHttps ? 'None' : 'Lax', +]); diff --git a/suitecrm-form-middleware/validate.php b/suitecrm-form-middleware/validate.php index ad44acf3..9bb1593b 100644 --- a/suitecrm-form-middleware/validate.php +++ b/suitecrm-form-middleware/validate.php @@ -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']}"); diff --git a/support/Http/SessionCookie.php b/support/Http/SessionCookie.php deleted file mode 100644 index 8995dc98..00000000 --- a/support/Http/SessionCookie.php +++ /dev/null @@ -1,22 +0,0 @@ - 0, - 'path' => '/', - 'secure' => $isHttps, - 'httponly' => true, - 'samesite' => $isHttps ? 'None' : 'Lax', - ]); - } -}