2012-01-23, 09:50 AM
Hello,
I'm trying to synchronize the login/logout process between wordpress and mybb. I've tried a few different things, but let me first tell you of the requirements.
The users to not need to be stored in the same database, but when a user logs in to wordpress, they need to also be logged in to mybb.
Now, I have sort of hijacked a Wordpress login widget and made some modifications so that when a user logs in, a POST request is made to another PHP file on the server which then attempts to authenticate the myBB user (using MyBB Integration Class).
By writing to a file on the server, I was able to observe that the MyBBI class reports that the authentication was successful, but alas, no cookies are being set, and so the user is not logged in.
I ventured to figure out why, but couldn't. My first assumption was that, probably my script was sending some non-header information to the browser before that point, thus my cookies couldn't be set. However, the Wordpress plugin sets some cookies nearly immediately afterwards, so I got a bit stuck.
If I could make that work, I could disable all logging-in/out from MyBB and restrict it to wordpress.
One thing that occurred to me, though, was that I might be able to force MyBB to use WordPress's cookies, which would really solve all of my problems in one fell swoop. Of course, I'd still have to restrict logging in/out to Wordpress, but I'm facing that prospect anyways.
I wondered, though, if the folks in the community here might have some suggestions that could solve my problems.
Thank-you
I'm trying to synchronize the login/logout process between wordpress and mybb. I've tried a few different things, but let me first tell you of the requirements.
The users to not need to be stored in the same database, but when a user logs in to wordpress, they need to also be logged in to mybb.
Now, I have sort of hijacked a Wordpress login widget and made some modifications so that when a user logs in, a POST request is made to another PHP file on the server which then attempts to authenticate the myBB user (using MyBB Integration Class).
By writing to a file on the server, I was able to observe that the MyBBI class reports that the authentication was successful, but alas, no cookies are being set, and so the user is not logged in.
I ventured to figure out why, but couldn't. My first assumption was that, probably my script was sending some non-header information to the browser before that point, thus my cookies couldn't be set. However, the Wordpress plugin sets some cookies nearly immediately afterwards, so I got a bit stuck.
If I could make that work, I could disable all logging-in/out from MyBB and restrict it to wordpress.
One thing that occurred to me, though, was that I might be able to force MyBB to use WordPress's cookies, which would really solve all of my problems in one fell swoop. Of course, I'd still have to restrict logging in/out to Wordpress, but I'm facing that prospect anyways.
I wondered, though, if the folks in the community here might have some suggestions that could solve my problems.
Thank-you