We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6806
    • 32 Posts
    Since MODx currently uses the default PHP sessions on disk, I’m going to run into some trouble when I move to a load-balanced cluster without taking care of this. Despite all the research I have done, I’m still confused about how to set up PHP to use a database to store sessions without having to go into all my applications and rewrite the session calls by hand.

    Can anyone point me to a guide that will walk me through setting up PHP to use custom session handlers and auto-prepend that to each file? (I assume this is what I need to do).

    All the solutions I have read involve manipulating the application PHP files, rather than system wide settings, and in the case of MODx, that just isn’t feasible.

    Thanks.
      • 22303 MODX Staff
      • 10,725 Posts
      That’s correct, it’s likely not feasible. Welcome to the worst feature of PHP IMHO. MODx 0.9.7 will come with the ability to define your own custom session_handler_class and will ship with a database session handler class by default.

      Unfortunately, I’ve attempted to work this into the 0.9.6 architecture with very little luck; there are a lot of places that would have to be hacked to accomplish this in the existing releases.
        • 6806
        • 32 Posts
        Thanks.

        I guess the only real solution until you release the next version is to do an NFS for the PHP session data?
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: dbowling at Oct 03, 2007, 03:18 PM

          I guess the only real solution until you release the next version is to do an NFS for the PHP session data?
          That sounds like the most reasonable solution, at least if you’d rather do system admin work, rather than some PHP hacking. I suppose it depends on your available resources and/or skills.