User has to re-log in on the Drupal side
Jay Matwichuk - November 12, 2008 - 02:33
| Project: | phpBBforum Integration module |
| Version: | 6.x-1.04 |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
I have set up this module (great little module by the way - thanks!), but when a user is logged in in PHPBB, then moves to drupal, they are not logged in. I have set up the authentication block, but the user still has to sign in when they come to the drupal side. Any ideas on why this may be?

#1
Bump
#2
just a guess: do you have cookies enabled?
#3
Yes. Cookies are enabled. Thanks for the suggestion though! Got any others?
#4
bumpity
#5
I tried uninstalling the module and reinstalling it, but it didn't seem to work. I got it to validate me as being a mod, and everything looks ok when I look at the settings page, but it will not log me in on the drupal side.
Has anybody been able to get this module to work? It's not a beta, but it doesn't really appear to work.
edit: well the blocks do. It just doesn't verify the user when they come to drupal from phpbb.
#6
I have had problems with this as well, although I can't quite isolate the cause. It was working perfectly for me when I was using phpbb 3.02, but when I upgraded to phpbb 3.03 and phpbbforum 6.x-1.04 it reappeared. Login synchronizes perfectly when I log in and out using the Drupal login, but not when using the phpbb login, although it appears to be a caching issue.
When you login to phpbb, go to the drupal page and when prompted to login again, click the login button WITHOUT typing the username and password, you should login with the username that is logged in under phpbb. I'm not sure what causes this, as it didn't occur when I reinstalled a fresh version on my test server, but hopefully it will help to determine the root cause.
Edit: It's definitely a caching issue. When I disable caching on the site, the functionality is perfect. Looks like something in the phpbb module needs to tell drupal that the hidden authentication block has been updated so it won't use the cache.
#7
I'm still having the same problem after disabling the cache. For the master login system, are you using phpbb, or drupal?
And what is 'phpbb authentication'? Any idea?
I think it's going to be up to us users to solve the problem, the mod author doesn't seem to support this mod.
#8
He most certainly does, but this isn't exactly a critical issue. When I reported that the mod failed when upgrading to the new version of phpbb 3.03, the mod author was kind enough to release a new revision of this mod the very next day.
Issues like this may or may not be related to the mod, and the support system at drupal.org is that the community and support volunteers do their best to assist in determining the cause of a problem. It would be impossible for mod authors to be expected to provide immediate free support for every user of their mods.
I'm sure that with a bit more troubleshooting we can determine where the problem lies, and if it is in fact a mod problem then I'm sure the author would correct it if possible.
In the meantime, make sure to disable page cache, block cache and then delete the cached data. After that, when logging into phpbb, remember that it takes a moment to synch back to drupal, so don't immediately switch pages, wait until the redirect on phpbb happens first. You should then be logged into Drupal.
Also, were you able to confirm that you can login to Drupal by simply clicking the login button?
I use phpbb as the master, as I have an existing database of phpbb users already.
#9
I didn't rate the problem as critical. Though it's not been easy having twenty users sending me email saying they can't log in. Even so, I only rated it as normal.
And while it may not be critical, the fact that the mod isn't working is a pretty big thing for me.
* I have disabled all caches, and cleared all data
* I have tried just clicking in on the login button, and it doesn't work
* I just tried loggin in on PHPBB and waiting for the redirect back to the index page, then switched to the drupal side, still no success.
Thank you for giving me some ideas though, I appreciate it.
#10
I just played around with it a bunch more - cleared all caches, and switched the master login to drupal, and everything seems to be working now. Thanks for your help.
#11
I have the same problem.
I have found out this situations:
New user visiting site:
Register, login, visit forum, etc. -> WORKING - still logged in
Next situation:
Make break - for example 8 hours not visiting site (don't know exact time) But when I go to bed and try it next day i doesn't work:
When I first visit Drupal site and then try to visit forum, then I'm logged off on the forum pages, but still logged in Drupal site.
And when I visit forum pages first, then when I go to Drupal pages I'm still logged in.
Do you know how to solve this? I tried to comment some cookie "killing" commands, but It didn't work.
But It's interesting, that after longer break when I visit forum before Drupal pages I'm still logged in, but when I visit Drupal pages first, then I'm automatically logged off from forum pages.
I can also post here address of my site if you are interested.
#12
I have DRUPAL as the master login and I DISABLE the ability to login or even view the login in phpBB. Everything works fine for me. Users login with Drupal. If they browse straight to the forum, they are redirected to the DRUPAL login page.
#13
I have something similar, but I want to stay logged forever. But everyday I visit my homapge first and then forum, I have to login in, because I'm logged off from the forum, but when I go to the forum first I am logged in.
#14
reply to #13 sasdad
Try increase your cookie timing for Phpbb3. By default phpbb3 only allow about 20 minutes of session, while Drupal 6 allows 22 days (is that 200000 seconds?) by default.
I believe that the two number should match in order to get a consistance experience, however since you won't get the phpbb3 cookie until you go there, it might be sorta useless.
I believe the best cause of implementation is to create both cookies at once regardless of where you login, and write / sync info to / from both places at once. However that might be hard to program.
#15
Thanks for an idea,
but cookies for forum are working if I go to forum after longer period of time.
But when I go to drupal site before visiting forum tha cookies for forum gets "deleted" or something like this so I'm logged into the drupal but logged off from forum.
Maybe it's possible to do something like you said in the last paragraph.
#16
I too believe the caching system have something to do with it. It take a few refresh on drupal sometime to notices I have login when I login from phpbb and then browses to drupal.
However this sorta thing happens when caching is disabled too. Luckily I don't need caching yet, but who knows?
#17
I was probably problem in configuration of PHP.
#18
If I follows this workflow, I can reproduces the problem every times on a non-embedded intergatation, whether it is 1.04 or 2.x. It should also work on a embedded integration but I have not tested that myself.
1.) Make sure Drupal's page cache is turn on
2.) Clear all browser cookie
3.) Navigates directly to the forum in your browser
4.) Login using PHPbb3 forum
5.) Close Browsers
6.) Open Browsers
7.) Navigates to Drupal front page
When you do that, drupal will not recognizes that you are logged in, it will treat you as anonymous user and will show you a cached page, if you click on something dynamically generated, (Like, do a search for example) it will then show you as logged in.
My theory is that Drupal's cookie were not created since we did not use drupal to login, and since it doesn't know you are already login, the page cache will be served, overriding the hidden authenication modules so a drupal cookie is not created, and making it shows that you are login to phpbb3 forum but not drupal.
A way to resolves this would be to create the Drupal's login cookie at the same time when we login to phpbb3 so pagecache can still be used on drupal.
#19
I've given up on this module and will be removing it from my site the next time I get a chance. It keeps working and not working intermittently. I'd rather just have a separate login for the Drupal side.
#20
I'm not sure what your comment have to do with this particular issue.
#21
I was the one who started the thread initially. It was basically follow up.
#22
Perhaps there is some misunderstanding about the way Drupal page cache works. By design. Drupal Page cache will put the entire page into the cache. A single module have no way to override that.
I think the only way to solves this issue is to carry the drupal login mechanism before we navigates to that page. Which might not be possible at all due to the way Drupal is designed.
Perhaps we can get some comment from the current active contributor? I made some attempt to resolves this issue but I was not able to get anywhere.
Since this issue effect all Drupal module, I felt that it is a bit unfair to place blame on the module for this issue.
#23
Hi to all.
In new extremly developing 2.x version of the module in the embed mode login and logout in Drupal are made with new internal hook system just after login and logout in phpBB without waiting for Hidden authentication block assistance.
So I expect it would be easier with the caching problem for unregistered users, but I did not test it.
In other modes almost nothing was changed.
The branch 1.0 did not develop more. All efforts will go to 2.0 in D6.
The only reason why not upgrade to 2.0 if you are still going to use not embedded modes is only that 2.0 requires php5 and 2.0 is not backported to D5.
The problem could be in Hidden authentication block or phpBB settings not setting up or working properly.
But I cannot do that for everybody or even support this.
In order to authenticate with Hidden block correctly you should setup in ACP these phpBB Settings according your layout:
1) Server settings.
Server URL settings
Domain name:
The domain name this board runs from (for example: www.example.com).
In drupal settings.php variable $base_url (if present) and Domain name must be both with or without www.
Domain name: www.example.com
$base_url = 'http://www.example.com';
or
Domain name: example.com
$base_url = 'http://example.com';
(!!!) Script path: /phpBB3
The path where phpBB is located relative to the domain
name, e.g. /phpBB3.
Force server URL settings:
Decide himsef, force or not to force.
2) Cookie settings.
(!!!) Cookie domain: .example.com
Cookie name: [random name]
(!!!) Cookie path: /
(!!!) Note: your domain name .example.com with leading dot.
In ver 1.04 for D6 you may disable block caching (already done in ver 2.0)
insert after line 1041
if (PHPBB_DRUPAL_MODULE_VERSION != 5)$blocks[0]['cache'] = BLOCK_NO_CACHE;
Should be
function phpbbforum_block($op = 'list', $delta = 0, $edit = array()) {
global $user;
if ($op == 'list') {
$blocks[0]['info'] = PHPBB_DRUPAL_MODULE .': '. t('Hidden authentication');
if (PHPBB_DRUPAL_MODULE_VERSION != 5)
$blocks[0]['cache'] = BLOCK_NO_CACHE;
Hope all this will help you.
#24
I have to express my gratitudes for the work you have done on this modules so far. With your development I will be looking into moving to embedded mode in the near future seriously. Iframe just doesn't attract me much, and my site do have quite a lot of traffic so hopefully I can help discovers some bugs as well.
Anyway, this particular issue have to do with page caching, not block caching. I know that it is possible to stop a block from being cached, but as far as I know there are no way to excludes a block from being page cached when it is turned on in drupal.
I have done brief testing with 2.x and found that it wasn't able to overcome the page cache issue if you use the phpbb3 login instead of drupal login, however I think it was still early in the alpha, I will give it another test.
I will also give this test for 1.04 but disabling block caching typically do not effect page cache issue.
#25
I know where could be the problem. There is some option to "delete" session when the site is in heavy load or something, this caused my problem. This option is in PHPBB, but currently I don't have access to this. So I can't write more.
#26
Interesting patch... I don't have a clean installation to apply this new version on. Well, I suppose I can install a new forum and drupal just to test this out, but it would be rather meaningless if I can't really spent the time to redo all the customization. Is there any way to do the patch manually?
If not, do you think we can reuse the login hook on the other integration method?
#27
You can download changed phpBB3 files from http://vgb.org.ru/files/phpBB-embed-3.0.4-files.zip
All changes are marked by //***VB***
You can find them and enter changes in your files manually.
>do you think we can reuse the login hook on the other integration method?
No, login hook works only in the embed integration mode, for other modes you can only use Hidden auth. block
#28
I used a duct tape approach and "Mostly" resolved the issue.
Downloads the module called cache exclude, it will exclude a page from being cached.
Create a page and mark it as excluded from cache.
Make an iframe in the "You successfully logged in" that point to that page. So now cookie in both Drupal and Forum will be generated at the same time when login at phpbb3.
I have experienced this and it appears to work for the most part. Sometime the redirect might happens before your cache excluded page loads, but I believe those are fairly rare. Page cache now works properly and will log user in regardless of minimum life time.
#29
The cache exclude doesn't seem to work properly, and respond a little slower then I want.
I uninstall the module altogether, turn on search, and changed the iframe to point to a search page, it have been working fairly flawlessly for my site so far. Login is now much smoother.
To specifies, I basically added something like
<iframe=http://yourdomain.com/search/sfnsdknrklwe> <p>your browser does not support iframe</p></iframe>directly in the language file ucp.phpDue to the "duct tape" nature of this fix, I don't think this issue can be considered fixed, but I don't see a better solution if you want to use page cache without integrated mode, unless we code a login API for drupal from sketch. But it is better then nothing.
#30
I am having to re-log in on the phpBB side now with version 6.x-2.0-beta5.
I didn't have to do this before. But now it seems like sessions and cookies are not being held long enough or correctly?
#31
I am having this issue too. When I'm logged in I can't access the Home Page as a logged in user, which is a minor issue. The problem clears temporarily when I erase all my cookies. I changed the cookie domain from example.com to .example.com with the leading dot as discribed in post #23.
It might have had something to do with not having a main $content region on the front page -- instead I have three columns, each their own region. I put the hidden login block in $content on the blocks administration page so it wasn't being called when the front page is loaded. I moved it to the footer which is called on every page and I hope that makes a difference.
Thanks people for you hard work.