We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36776
    • 31 Posts
    https://forums.modx.com/thread/76328/cant-get-session-from-another-system

    I also have this thread, but as my question is between a bug/feauture request/help, so I think this category is a better fit.
    I have a session created when logging in to WHMCS.

    When using a script like this:
    <?php
    require( "dbconnect.php" );
    require( "includes/functions.php" );
     
    if ($_SESSION['uid']) {
        echo "Yay, this works.";
    } else {
        echo "No, this does not(!) work! :-(";
    }

    ...It all works good.

    But when entering this in a Snippet, it dont work. It looks like MODX is cleaning the session from WHMCS.
    So the code work in e107, a normal php file, ++. But not in MODX.

    I have tried setting the session_handler_class to empty to use PHP builtin session handling, but that didnt work either.

    The code over prints "No, this does not(!) work!" no matter how i type it in.
    I have also tried session_start in the code, but still the same problem.


    So:
    * Isn't this possible in MODX?
    * Or is it a bug?
    * Or am I missing something?

    I appreciate all help regarding this matter!

    EDIT:
    Let me also add that this script will show a login form for new guests, and customerinfo to logged in users in WHMCS.
    WHMCS is in the exact same folder, domain and database.

    This question has been answered by opengeek. See the first response.

    • discuss.answer
      • 22303 MODX Staff
      • 10,725 Posts
      Please do not cross-post. If you want to move the OP, we can do that...