0

I've been on my site and I allow users to upload URLs to images they can use for their display image however I've been getting a lot of SameSite request popups in my developer log and I'm trying to fix this issue. I don't want any of my cookies being sent to any third parties, only my subdomains. How do I go about setting this through session start?

session_name('example_cookie');
session_start([
    'cookie_lifetime' => 0,
    'cookie_path' => '/',
    'cookie_domain' => '.example.com',
    'cookie_secure' => false,
    'cookie_httponly' => false,
    'cookie_samesite' => 'Strict'
]);

Keeps throwing an error constantly saying. "PHP Warning: session_start(): Setting option 'cookie_samesite' failed in /home/path/to/php/connection.php on line 6" What am I doing wrong?

  • This option is version-dependent. – mario Apr 12 '20 at 02:58
  • These posts set options through set_cookie_params() function and not session_start(). I'm trying to set it through session_start and keep my code clean and simple using as few different functions as possible. I'm using PHP version 7.2. If there's a way to set it through the session_start that would be lovely. – Schmidtzilla Apr 12 '20 at 03:09

0 Answers0