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
-
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.
-
☆ 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.