MODx handles it’s own sessions, so you cannot start another session within a MODx request. You’ll need to look into using the events related to WebUser login to perform the auto-login to these other packages without manipulating the session. The SMF Bridge module may provide some inspiration on how to accomplish this, but it will depend heavily on how the target package handles authentication itself...
Hi, I want to have a snippet process a login form that automatically logs the user into another package (phpbb and oscommerce) so I need to muck with session vars and perhaps redirect using headers() to another page.
What’s the best way to setup the snippet so that I can process and still do header manipulation and/or start a session?
My only thought is to put the snippet at the top of the template (before any output) to do the processing, and another snippet with the login form itself. Any better way?
thanks much
MODx handles it’s own sessions, so you cannot start another session within a MODx request. You’ll need to look into using the events related to WebUser login to perform the auto-login to these other packages without manipulating the session....
If all you want is a redirect, you don’t need to manipulate the headers yourself, just call $modx->sendRedirect()
MODx handles it’s own sessions, so you cannot start another session within a MODx request. You’ll need to look into using the events related to WebUser login to perform the auto-login to these other packages without manipulating the session....
Thanks OpenGeek, I will look into the SMF Bridge, but I won’t be using MODx web users for now. I want to take a login and authenticate for the other package (verify user and set session vars myself, it’s fine if the session is already started).
So...what’s the best way to output to headers using snippets? Just looking to see if I’ve missed anything...
thanks
If all you want is a redirect, you don’t need to manipulate the headers yourself, just call $modx->sendRedirect()