The following is a quick description of how I debug login problems in cases where the user is logged into Drupal, but not in phpBB or mysteriously falls out. This is also a respons to kjuib's request below, but it is easier to refer to later when it is a separate story.
EDIT: As of 01/2008 the _k cookie / user key table is no longer set. Long sessions should be used instead. The reason is that phpBB and Drupal should use the same mechanism, and Drupal only supports session ids.
1) Clear the cookies in your browser
2) Go to the Drupal front page (Drupal will not log you in on the first page view after clearing cookies, so you need to refresh this page before using the login form).
3) Clear the phpbb_sessions_keys , and phpbb_sessions tables (using phpMyAdmin or something similar)
4) Login to Drupal. Do not go to any other page.
5) Verify that the phpbb_sessions_keys has a new row with the correct user id See above.
6) Verify that you have three cookies names phpbb_something_sid, phpbb_something_u, phpbb_something_k,
check the contents of _u and _k , they should respond to the user id and the inverse md5 of the key.*
7) Go to the forum, check the login link to see whether you are shown as logged in or not.
8) Verify that you have the same cookies as before. If you have two sets of cookies for phpBB, check the path and domains.
9) Go to a new page in the forum, check 8 again. The reason for doing this is that phpBB can show you as logged in on the first page and kick you out on the second.
10) Log out. Verify that the phpBB cookies are deleted, or at least that the _u is set to anonymous. Note that some browsers, like Firefox, don't update the list of cookies correctly when cookies are removed / expire.
*: If your cookie contains "12d354ddfda9a2a8" , then go to http://weirdsilence.net/tools/md5calc/ (or any other MD5 calculator) and paste this into the field. For the value above, "dfa340732d42215f70604849a140a32d" is returned. You then go into the phpbb_sessions_keys table (again, using phpMyAdmin) and search for the row with key_id equal to "dfa340732d42215f70604849a140a32d".
Comments
Error at step 8
when I browse to the forums page I get another set of cookies.
original: test.asdf.com
new set: .test.asdf.com
it seems to add an extra period at the start. I tried playing with the phpbb cookie domain to no avail... any suggestions?
What is the cookie domain
What is the cookie domain set to in the phpBB admin section?
As suggested ( http://groups.drupal.org/node/5855 ), try setting it to asdf.com. Leaving the field blank also works for me.
Also make sure you are running the latest version of the module. I patched something (too lazy to look up the subversion log right now) on the afternoon of the 28th.
update
I tried the following for the cookie domain: asdf.com, test.asdf.com,
I also updated the module to the latest... some problem is happening though.
Once I login with drupal I get 3 new cookies:
They have a Host: test.asdf.com
Once I open the forums page I get 3 new cookies:
They have a Domain: .test.asdf.com
I also noticed that sometimes the .test.asdf.com _u cookie has a value of 1 instead of the user id 1001 (the user I log in as).
Thanks for being so quick on the replies.
EDIT: I did get it working... but I had to put .test.asdf.com in for the phpbb cookie domain... now the user stays logged in on the forums.
Ok, good. Can you confirm
Ok, good. Can you confirm that you downloaded the module after the 28th, and that you are indeed using phpBB RC5?
sure can...
I downloaded the rc5 last week... and I just updated to the latest module yesterday when you brought up that you did changes.
More questions
Ok, two more questions, because I still can't see why the installations behave so differently.
What versions of PHP and Apache are you using?
What is the cookie_domain value in global_config.php (or something similar) in the phpBB cache directory?
Apache: Apache/2.0.52 (Red
Apache: Apache/2.0.52 (Red Hat)
PHP: PHP/5.2.3
The file was: data_global.php
and the cookie_domain is currently: .test.asdf.com
cant log in anymore
Hi,
i cant log in anymore in phpbb 3 RC5 :(
i followd the instructions above and still cant log in!..
now where running php 5.x and apace 2.xxx and MYSQL 5.xx
but i think i have found the problem.. when i rename the htacces in the forum dir i can log in and do like always posting.. so i gona comment out the lines for log in and so untill you have a beter solution.
ow yeah i deleted the sessions table by acident and added it already back and then deleted the session_keys table content and know phpbb is saying i'm the newest user....
but i think it cause i made a drupal users and deleted in drupal and phpbb..
I think you should start
I think you should start from scratch. If you have users in Drupal, that is fine as long as nobody with a user id of less than 100 logs in.
That would overwrite the search engine users that phpBB includes by default. You can of course delete them or change their user id, but be thorough, leftovers will probably create problems since you then have something that is both a search engine and a regular user.
When I say clear the database I mean purge all the rows, the table structure should never be deleted.
@arkepp..,yeah.. but the
@arkepp..,yeah.. but the strange thing is when there is NO redirect to the drupal login everthing works fine.. the users can log in on both but when these RewriteCond %{QUERY_STRING} ^mode=login(.)$
RewriteCond %{QUERY_STRING} !^bypass=true(.)$
RewriteRule ^ucp.php(.*)$ ../phpbb/login [L]
are uncommented i cant log in cause i'm the super users in drupal..,and starting from scratch is crazy :P its a live site with more then 153 users..
and yeah i know but i pressed the wrong button in phpmyadmin :$
anyway thx for the good support :)
but i still have stil have no avatars on the forum..
Step 8 screws me
Hello there,
Everything was working perfectly in my test subdomain.
However, when I moved it to the main domain, I cannot login to the forum.
So I moved it back to the subdomain, and I still cannot login to the forum.
I went through the steps, all was perfect, even the reverse md5, until step 8.
There, I go past the index and I am logged out. There is a new cookie added at that point called SESS****(lots of numbers). It appears to have an MD5 value.
Any help? Thanks in advance.
sounds like a problem that I
sounds like a problem that I also had
Did you flush the cache of phpbb ?
AmigoB
Another error at step 8 solved
I had the two set of cookies too. I solved this setting cookies from my phpbb administration in this way:
domain: mysite.it [so without any dot before!]
cookie path: /
step 5
I get new row in "phpbb_sessions". Table "phpbb_sessions_keys" is stil empty.
http://www.slap-on.net/phpbb/diagnostic
So what do i have to do?
Edit: I was install drupal+phpbb again .. and for now it works.
I'm really do not follow all
I'm really do not follow all the steps mentioned here guys, may you please any one accept or agree to add me to messenger for just 5 minutes to let me know how to do it?
Please help me with this issue or if any one here can do it I can give you my username and password to access the website.
Please help
Thanks
_k cookie OK (Not set)
Hi
After I run the diagnostic test I've found this row in the table
_k cookie OK (Not set)
Please tell me what is it.
Thanks
It means that the
It means that the "permanent" login cookie has not been set. This is okay, because it's (currently) not used.
Problem at step 5
After i login to drupal, phpbb_sessions_keys table still remains empty!
Due to this, i get logged out of phpbb after a while where as im still logged into drupal.
Could someone help me understand this problem...
See EDIT above, I added
See EDIT above, I added strike to 5) to make it more clear.
step 6
Hi,
This module isn't working yet for me. Users arent getting logged into phpBB. One thing I am noticing is that phpbb_oacz1_u , _k etc are not set until the drupal user clicks on website.com/phpBB . Your instructions seem to indicate that these cookies need to be set as soon as the user logs into drupal. How do I fix this?
Another thing I have noticed is that website.com/phpBB/diagnostic doesn't really do anything for me, it brings me back to the drupal home page. Is there something new I need to add in phpBB/.htaccess for this link to work?
I'm having the same problem,
I'm having the same problem, did you ever manage to resolve it? I'm using phpbb 3.0.4, don;t know if this is an issue.
Cheers,
Neil
--
Drupal Development for Pleasure and Profit
http://drupal.altate.ch
--
Open Source Web Solutions
http://cameronandwilding.com
to add to my previous post,
to add to my previous post, apache error logs report this : File does not exist: /var/www/html/sandbox/phpBB/diagnostic
the module is definitely installed..