Page 1 of 2

Sessions Settings - Possible regression with `Form::hide_session_id()` after PHP 8.4 session changes (v1.1.0.7)

Posted: Wed Aug 05, 2026 12:35 pm
by azpro
While upgrading my testshop to Phoenix 1.1.0.7, I noticed what appears to be an inconsistency regarding session handling in the admin.

### Configuration

* Phoenix 1.1.0.7
* PHP 8.0.30
* **Force Cookie Use = True**

### Test case

Using a simple GET form in the admin:

Code: Select all

<?= (new Form('status', $Admin->link('orders.php'), 'get'))->hide_session_id() ?>
Submitting this form causes my admin session to be lost and I am redirected to the storefront.

If I remove only hide_session_id()

Code: Select all

<?= (new Form('status', $Admin->link('orders.php'), 'get') ?>
the same form works perfectly.

Additional observation - If I set:

Force Cookie Use = False


the admin form also works, but the storefront starts appending the session ID to URLs again, for example:
shopping_cart.php?sort=1a&ceid=xxxxxxxxxxxxxxxx


So I end up with:

Force Cookie Use = False

* Admin GET forms work.
* Session ID (`ceid`) is appended to storefront URLs.

Force Cookie Use = True

* Storefront URLs are clean (preferred).
* GET forms using `->hide_session_id()` lose the admin session.

Looking at commit https://github.com/CE-PhoenixCart/Phoen ... 77a35aae8b

I noticed that the PHP 8.4 session changes modified both:

* includes/system/segments/application/start_session.php
* includes/system/versioned/1.01.00.07/form.php

It seems that hide_session_id() now always adds the current session ID whenever a session exists, while Href already respects the **Force Cookie Use** setting.

### Question

Is this the expected behaviour?

Should `Form::hide_session_id()` also respect the **Force Cookie Use** configuration when using GET forms, or is there something in my configuration that I have overlooked?

I appreciate any feedback before I start modifying Core code ;) .

Thanks!

Re: Sessions Settings - Possible regression with `Form::hide_session_id()` after PHP 8.4 session changes (v1.1.0.7)

Posted: Wed Aug 05, 2026 2:34 pm
by burt
@BrockleyJohn

Re: Sessions Settings - Possible regression with `Form::hide_session_id()` after PHP 8.4 session changes (v1.1.0.7)

Posted: Tue Oct 20, 2026 10:25 am
by PiLLaO
I'm in the same situation, after apply the commit have the same issue.

all urls have ceid, only get off if enable "force use cookies" and I never have this option active before...

And in admin, when using dropdown selection redirect to storefront

Re: Sessions Settings - Possible regression with `Form::hide_session_id()` after PHP 8.4 session changes (v1.1.0.7)

Posted: Tue Oct 20, 2026 3:11 pm
by PiLLaO
While I upgrade for newer version and I can check if works... I deleted

* includes/system/versioned/1.01.00.07/form.php

And change the fix:

Code: Select all

$SID = (! empty(session_id()) ? session_name() . '=' . session_id() : '');
with:

Code: Select all

$SID = (session_id() != '' ? SID : '');
That works (for me) like previous code and don't need to active "Force Cookie Use" and admins works again ok

Code: Select all

$SID = (defined('SID') ? SID : '');
Regards

Re: Sessions Settings - Possible regression with `Form::hide_session_id()` after PHP 8.4 session changes (v1.1.0.7)

Posted: Tue Oct 20, 2026 3:21 pm
by burt
@BrockleyJohn thoughts?

Re: Sessions Settings - Possible regression with `Form::hide_session_id()` after PHP 8.4 session changes (v1.1.0.7)

Posted: Tue Oct 20, 2026 3:28 pm
by PiLLaO
Don't works, I'm still looking for a solution, sorry

Re: Sessions Settings - Possible regression with `Form::hide_session_id()` after PHP 8.4 session changes (v1.1.0.7)

Posted: Tue Oct 20, 2026 4:09 pm
by PiLLaO
As I see it, the original code contained the session name and ID only upon the first visit to the website; afterwards, it was always empty, which is why it wasn't being appended to the URLs.

The new code, $SID always contains the session name and ID, and for that reason, it is always appended to the URL.

Piece of code from includes/system/versioned/1.0.8.5/href.php

Code: Select all

// Add the session ID when SID is defined
      if ( $this->include_session
        && Session::is_started()
        && isset($GLOBALS['SID'])
        && !Text::is_empty($GLOBALS['SID']))
      {
        $this->parameters[session_name()] = session_id();
      }

Re: Sessions Settings - Possible regression with `Form::hide_session_id()` after PHP 8.4 session changes (v1.1.0.7)

Posted: Tue Oct 20, 2026 5:32 pm
by PiLLaO
This is not a fix it's to hide the error from error_log

Code: Select all

// set SID once, even if empty
  // $SID = (defined('SID') ? SID : '');
  $SID = (defined('SID') ? @constant('SID') : '');

Re: Sessions Settings - Possible regression with `Form::hide_session_id()` after PHP 8.4 session changes (v1.1.0.7)

Posted: Wed Oct 21, 2026 8:34 am
by BrockleyJohn
I will try harder to reproduce this, and get back to you!

Re: Sessions Settings - Possible regression with `Form::hide_session_id()` after PHP 8.4 session changes (v1.1.0.7)

Posted: Wed Oct 21, 2026 10:16 am
by PiLLaO
I just install to test a new v1.1.0.8 and ceid never hide