Page 1 of 1

Pass $_SESSION to iframe

Posted: Thu Jan 06, 2022 2:13 pm
by LeeFoster
My Phoenix site is anything but your typical shop and I now have a need to pass session variables to an iframe that loads another page.

I've read it can be fixed by adding

Code: Select all

ini_set('session.cookie_samesite', 'None');
      @ession_set_cookie_params(['samesite' => 'None', 'secure' => true]);
before session_start() only that doesn't exist as such.

I'm using CE Phoenix v1.0.8.5 if that's important

Re: Pass $_SESSION to iframe

Posted: Thu Jan 06, 2022 2:33 pm
by ecartz
Look in the catalog/includes/configure.php file for https://github.com/CE-PhoenixCart/Phoen ... p#L25..L30

Code: Select all

  define('COOKIE_OPTIONS', [
    'lifetime' => 0,
    'domain' => '',
    'path' => '',
    'samesite' => 'Lax',
  ]);
You may have to add the secure line, but you can just edit the samesite.

Re: Pass $_SESSION to iframe

Posted: Thu Jan 06, 2022 3:13 pm
by LeeFoster
ecartz wrote: Thu Jan 06, 2022 2:33 pm Look in the catalog/includes/configure.php file for https://github.com/CE-PhoenixCart/Phoen ... p#L25..L30

Code: Select all

  define('COOKIE_OPTIONS', [
    'lifetime' => 0,
    'domain' => '',
    'path' => '',
    'samesite' => 'Lax',
  ]);
You may have to add the secure line, but you can just edit the samesite.
Nope that didn't work. It may be the code in general though not your solution.