We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1535
    • 84 Posts
    Hi.

    I made a new table in the database for storing some snippet output temporarily between pages.

    Is this the best approach to do this or is there some other built-in storage facility that persists between pages?

    If this is a good way, I would like to ensure that my table does not interfere with MODx’s internal processes, such as upgrades and such.

    Any input here would be appreciated.

    Cheers,

    Andreas
      • 27376
      • 576 Posts
      If the temporary storage is for a single user, I’d recommend using the $_SESSION variable, it’s faster than writing to the db.
        • 1535
        • 84 Posts
        Thank you very much.

        Sessions does not seem to persist on my setup, is there a configuration for its setup?

        Cheers,

        Andreas
          • 1535
          • 84 Posts
          I got it.

          I just needed to start the session before setting the $_SESSION variable.

          Thanks again.

          Cheers,


          Andreas