Page 1 of 1

Adding Custom Sessions

Posted: Fri Oct 03, 2025 1:17 am
by levelup
I'm trying to figure out the best way to include a session that is created outside of PhoenixCart (but on the same domain).

I've tried to create a hook to check and I wanted to see if I was on the right track.

Code: Select all

  class hook_shop_system_sessionCheck {

    function listen_injectAppTop() {
      
      include($_SERVER['DOCUMENT_ROOT'] . '/session_made_here.php');

      if (isset($_SESSION['test_session'])) {
        // -- Do Stuff Here
      }
    }
  }
Of course, this doesn't work and I'm not even sure if I'm using the right "listen_inject" function.

Re: Adding Custom Sessions

Posted: Fri Oct 03, 2025 7:47 am
by burt
Could you explain what the SESSION value needs to do in the Phoenix part of your site ?

Re: Adding Custom Sessions

Posted: Fri Oct 03, 2025 2:07 pm
by levelup
burt wrote: Fri Oct 03, 2025 7:47 am Could you explain what the SESSION value needs to do in the Phoenix part of your site ?
For sure, so the session is created during a separate login before viewing the catalog. The login piece works fine and my only hiccup is including the session that is created after logging in into PhoenixCart.

In the old osCommerce day, I would've put my session check logic in application_top.php. I'm just trying to figure out a proper way to avoid messing with application_top.php via a hook.

Re: Adding Custom Sessions

Posted: Sat Oct 04, 2025 3:34 pm
by burt
I think you're right on using a system hook.
Try injectRedirects listener.

Re: Adding Custom Sessions

Posted: Sun Oct 05, 2025 5:50 am
by ecartz
You can only have one session open at a time. So you should open your special session first; do whatever; close it; open the regular Phoenix session. hook_shop_system__09_sessionCheck->listen_startApplication

Re: Adding Custom Sessions

Posted: Tue Oct 07, 2025 3:55 pm
by levelup
Today I learned! Thank you, this will at least steer me in the right direction.