I have a Pressflow 6.15 site set up. I have logintoboggan installed and running and most everything triggers as it should, BUT my user is only temporarily logged in.
Here's the breakdown - and I'll give the fix - for what happens, but I'm not sure the exact culprit (nor am I sure I have the time to completely track it down).
Basically, logintoboggan_process_login gets called, generating a logged in user, however (and I'm guessing it's cookie related), once everything processes, drupal_session_commit (as Drupal is cleaning up) destroys the logged-in-status of the user resulting in an access denied after redirect.
The fix is 1 line. If you need a real patch for the file, I'll generate one, but it's absurdly small:
function logintoboggan_process_login($account, $edit, $redirect = array()){
global $user;
$user = $account;
+ drupal_session_regenerate();
watchdog('user', 'Session opened for %name.', array('%name' => $user->name));
This prompts Drupal to pass through all of the appropriate session opening, generation, etc that it would normally handle and fixes the issue. I can't guarantee I've tracked back all the symptoms (so it might not be the absolutely optimal solution), but it solves a significant issue I encountered with the "Immediate Login" functionality.
Hopefully that helps, and sorry I don't have time to provide more.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | logintoboggan-immediatelogin.patch | 476 bytes | remi |
Comments
Comment #1
drupalok commentedi have normal drupal installation but it says: function not found when i add
drupal_session_regenerate();
what is the problem?
Comment #2
hunmonk commented#453582: "Immediate Login" not working for me
Comment #3
remi commentedI'm reopening this ticket because the duplicated issue referred to in the previous comment isn't accessible.
Also, I'm having the same problem. I tried the solution proposed here, but it had no effect.
Comment #4
remi commentedIn my settings, users are allowed to register themselves, but must activate their account via a link sent to them via e-mail. When filling the registration form, the user is redirected to a page explaining this process. When clicking on the link, the user should be brought to the site and redirected to a specific "thank you" page after their account is activated, which is what "Immediate login" should do when enabled. The problem is users can activate their account, see the "thank you" page, but are not logged in automatically. On a side note, I am also using PressFlow 6.16.77 which is based on Drupal 6.16 with LoginToboggan 1.6.
I did a fix similar to what was proposed, in the logintoboggan.module file at line 951:
After:
I added:
Before:
That seems to be doing the trick for me. I've also included a patch file for you to apply and test.
Comment #5
hunmonk commentedthis issue has been addressed in http://drupal.org/node/797142