We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3232
    • 380 Posts
    I am creating my own login script and can’t get sessions to work. Does Modx prevent my custom sessions from being set?

    Thanks
    Brian
      • 22303 MODX Staff
      • 10,725 Posts
      MODx controls the sessions. You can add your own custom session data into the session by using plugins with the various events associated with login, logout, etc., but you cannot currently provide a custom session handler implementation without modifying some core MODx files.

      In the next major release following 0.9.5, in addition to an optional session handler class that manages sessions in the database, you will be able to provide your own custom session handler code to override the default.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        In a way it could be done. CubeCart handles it nicely. On first page access, it assigns a random hash which is stored in the regular SESSION. All user data is kept in the database, with the hash as a key. Even on login, the user data is kept in the secondary session in the database. A plugin would handle this nicely.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org