I installed Drupal and SMF, then the module. The profile syncing works fine, but I can't get logins working, much like http://vgb.org.ru/forum/index.php?topic=35.0. I get the

You are not authenticated in SMF now. Please login to SMF and test again. You may refresh settings!

problem, even though I am authenticated. I've read through all the posts on this topic and the links in them, and I've tried disabling the settings "Enable local storage of cookies" and "Use subdomain independent cookies" as suggested. My authentication still doesn't work.

www.ausds.net is the website.
www.ausds.net/forum is the forum.

If I use the SMF user login block, it logs me into SMF but not Drupal. Even www.ausds.net/user will not log me into Drupal in that case. If I want to log into Drupal I have to delete smf_api_2.php, log in and then re-upload it. I have temporarily disabled the SMF user login block and enabled the Drupal one just so that I can log in.

I have checked and the SMF and Drupal cookies are both on the same host (their host is set to ".www.ausds.net").

Comments

vb’s picture

Make sure you have the base URL's same through out the site.

All base URL's and links from SMF to Drupal and from Drupal to SMF have to start (with www) or (without www).
You have to change the values of $boardurl in smf/Settings.php and $base_url in drupal/sites/default/settings.php to have same base URL's.

Set also all links from Drupal to forum or from forum to Drupal with www. or (without www).

After you do this, you go to SMF >> Admin >> Themes and Layout >> Themes and Settings >> click on "Attempt to reset all themes" in the "Reset Theme URLs and Directories" box.
SMF >> Admin >> Theme Settings >> THEMES AND SETTINGS

and set www. also

Theme Settings - SMF Default Theme - Core
Theme URLs and Configuration
This theme's name: SMF Default Theme - Core
This theme's URL: http://www.mysite.com/smf/Themes/default
This theme's images URL: http://www.mysite.com/smf/Themes/default/images
This theme's directory: your absolute site path/smf/Themes/default

In layouts like

www.mysite.com is the website.
www.mysite.com/forum is the forum.

Ensure that these settings were unchecked
SMF >> Admin >> Server Settings >> Feature Configuration

Help Enable local storage of cookies
(SSI won't work well with this on.)

Help Use subdomain independent cookies
(turn off local cookies first!)

Set the
Default login cookies length (in minutes) [1440]

The qookie authetication test shows if smfforum.module authenticates you on the forum with the qookie.
The test shows that something wrong with the qookie or your SMF and Drupal domains are different or have layout that smfforum.module not supports.

To pass this qookie authetication test you should:

1) login in SMF with this admin password
2) login in Dupal with this admin password
3) Go to SMFforum settings and see 4 line (or refresh the browser if you are already in there)
See radio buttons. You may choose Test and save settings.

If you see red line that means that something wrong with the qookie and smfforum.module treats you as unauthenticated.

When you log in SMF see in browser qookie like SMFCookie999 (or so)
When you log in Drupal see in browser qookie like SMFCookie999 (or so)
If you see 2 qookies that is not wright. It means that something wrong with the your settings..
You shoud see only one SMF qookie line, that is ok.

You should try to adjust your links, settings or your environment.

manefraim’s picture

I found that this problem was caused by a change of hostname address. Once the hostname changed, even after modifying both SMF's Settings.php file to reflect the changes, and modifying theme hostname locations in the SMF db, the problem persisted.

However, I was able to easily fix the problem by merely deleting the cookies associated with both the current and former hostnames from my browser cache.

Presto. The ISH WORKS AGAIN.

I love SMF forum, but I am not a fan of embedding the ip's in the database's theme tables . I imagine there is a valid reason for the methodology, but it's a hassle if you're developing and need to change hostnames often -- for instance using Amazon's EC2, or a spawned VMWare instance.

gunthehun’s picture

Thank-you so much for such a detailed solution.

Seasons greating to you and yours.

zet’s picture

Vb I thank you too for your detailed solution. I was having the same problem in Drupal 6
You should add this as a WARNING in your module readme file or documentation.
SMF forum has automaticaly added www in front of my domain in the base URL even if I have installed smf from my domain without www and I even have enabled drupal htacces rewrite of http://www.daciasanderoclub.ro to http://daciasanderoclub.ro . I have not thinked about that this could be a problem.

Thanks again for your wonderful module.

PS: Maybe you should answer here : http://drupal.org/node/112116 , so everyone gets happy. Seems like a little more detailed and strict documentation is needed so that others don't make those mistakes again.

kenathas’s picture

Hi,

I have a fresh install of Drupal 6 and smf.

Here is what I was wondering. If all is correct, should an already authenticated user be able to log into drupal and automatically then be logged in to smf?

I had to log into both seperately.

So, I did what you stated here.

I got confused because you stated I could use without without www

Then later you show how it should look with the www.sitename..... for the smf theme settings.

I didnt have www so i put that in. All my urls are using non-www

I finished all your setting instructions.

Now I can not log out of either drupal or smf....

I cleared cookies, temp files and no help.

Any thoughts?

Thank you so much.

Ken

mliu777’s picture

Thank you so much for this detailed solution! I'm using version 6.x and had the same problem as jedi but this solution still solved my problem. The part that fixed it for me was:

"Ensure that these settings were unchecked
SMF >> Admin >> Server Settings >> Feature Configuration

Help Enable local storage of cookies
(SSI won't work well with this on.)"

I guess my installation defaulted to this box being checked.