I have searched the forums but haven’t found an answer so will ask here. I have a web site up using modx with smf for the forums. I am having a difficult time keeping the users logged in even if they click "remember me". If the php session information has been garbage collected, then the modx pages require a login again, but the smf pages do not. The smf login is working fine as it saves the session info in the database. The problem is when users switch between the pages, they are still logged in to the smf forums, but not the modx pages. It causes quite a bit of confusion when they are logged in on one page, but not the other.
I have configured php to use a directory (session.save_path) for the sessions, yet something is still garbage collecting them every day or so. This is on a fedora core 5 (linux) system, apache, php 5.1.6. Even if I figure out what is garbage collecting the sessions, I still need a way for the users to be remembered forever if they want so they do not have to log in again. I don’t think depending on the session being there is going to work if they do not access the system for a week or so.
I notice that on this site, I can login and say "forever". Is this the smf login?
Any pointers to discussions about this or other help would be appreciated.
-
MODX Staff
- 10,725 Posts
Which version of MODx? Until the 0.9.5 final release, there was a major problem with the cookies being used for MODx login. They were basically useless and would not re-initiate an existing session once the browser was closed. This is fixed in 0.9.5, but I’m not sure the SMF bridge has been thoroughly tested with this release.
Regardless though, the fact remains that SMF uses a db and can persist the session beyond the PHP garbage collection time out, which is generally set to happen every 20 minutes by default. MODx does not, and is limited by the php.ini settings. You can attempt to set these in the startCMSSession() function defined in the config.inc.php file, and I believe there are some posts in this regard here in the forums that might help out; I just can’t find them at the moment...
The next minor release of MODx (0.9.7) will include db session management by default, and will also allow custom session management implementations to make these kinds of integrations much easier to deal with.