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

Open to all! Ask other shopowners for help.
Post Reply
azpro
Contributor
Posts: 177
Joined: Fri Nov 06, 2020 8:25 am
Phoenix Version: v1.1.0.6
Has thanked: 30 times
Been thanked: 34 times

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

Post 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!


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

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

Post by burt »

@BrockleyJohn
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply