Answers.Body: <p>Are your users perhaps logging into an https page and then following a link to a http page (or vice-versa) ? I have seen such issues in that case. You need to be consistent, and set the Drupal $base_url, Civi CIVICRM_UF_BASEURL, and $civicrm_setting['URL Preferences'][] values all to either http or to https, and change any links in your content to use that same scheme also.</p>
  
  <p>If you are not defining all four $civicrm_setting['URL Preferences'][] values in civicrm.settings.php, then those values are instead defined at Administer | System Settings | Resource URLs. While there, verify that the value of "Force Secure URLs (SSL)" is consistent with your intended scheme.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-25T03:05:46.087Z
Answers.Text: I agree that this is likely.  There's a good explanation here: https://civicrm.stackexchange.com/a/3233/12
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-25T01:52:28.237Z
Answers.LastActivityDate: 2017-05-25T02:10:33.817Z
Answers.LastEditDate: 2017-05-25T02:10:33.817Z
Answers.UserDisplayName: BobS
Body: <p>This is happening inconsistently, but often enough to be a problem.</p>
  
  <p>So far, we have come across two issues with it:</p>
  
  <p>#1 -  A new user registers for the site.  That user is then taken to a CiviCRM form for them to choose their payment level.  Sometimes, the user is logged out between the drupal registration form and the CiviCRM form, leading to them being prompted to log in again when they reach the Civi payment form.</p>
  
  <p>#2 - Background: We are currently testing some changes to our site, and so the admins all have multiple accounts, most of which have admin permissions.</p>
  
  <p>An admin logs into the drupal site, and then goes to CiviCRM.  For some reason, though, they are logged into one of their other admin accounts on CiviCRM.  They go to "Find a member", and then click the link to the member's drupal profile.  When Civi takes them back to drupal, it throws an error because they are logged into a different account on Drupal than on Civi.</p>
  
  <p>We are using Drupal 7 and CiviCRM 4.6.28</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-25T02:13:43.350Z
Comments.Text: Kimberlie - you may need to flesh this out more, ie be very specific about what you means by 'a user registers for the site'. Are they filling in the Drupal User form, are there any Civi Profiles set to be filled in as part of that, etc etc. Also what do you mean by 'admins have multiple accounts'? Each user should have a record in the uf_match table which links them to a unique civi contact.
Comments.UserDisplayName: petednz - fuzion
Tags: <drupal><forms>
Title: User is logged into different account on CiviCRM than Drupal
ThreadText: # User is logged into different account on CiviCRM than Drupal
  
  (Asked by: username_0 on 2017-05-24)
  
  This is happening inconsistently, but often enough to be a problem.
  
  So far, we have come across two issues with it:
  
  #1 - A new user registers for the site. That user is then taken to a CiviCRM form for them to choose their payment level. Sometimes, the user is logged out between the drupal registration form and the CiviCRM form, leading to them being prompted to log in again when they reach the Civi payment form.
  
  #2 - Background: We are currently testing some changes to our site, and so the admins all have multiple accounts, most of which have admin permissions.
  
  An admin logs into the drupal site, and then goes to CiviCRM. For some reason, though, they are logged into one of their other admin accounts on CiviCRM. They go to "Find a member", and then click the link to the member's drupal profile. When Civi takes them back to drupal, it throws an error because they are logged into a different account on Drupal than on Civi.
  
  We are using Drupal 7 and CiviCRM 4.6.28
  
  **Tags:** drupal, forms
  
  > **Comments:**
  > **username_1**: Kimberlie - you may need to flesh this out more, ie be very specific about what you means by 'a user registers for the site'. Are they filling in the Drupal User form, are there any Civi Profiles set to be filled in as part of that, etc etc. Also what do you mean by 'admins have multiple accounts'? Each user should have a record in the uf_match table which links them to a unique civi contact.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-05-25. Score: 1
  
  Are your users perhaps logging into an https page and then following a link to a http page (or vice-versa) ? I have seen such issues in that case. You need to be consistent, and set the Drupal $base\_url, Civi CIVICRM\_UF\_BASEURL, and $civicrm\_setting['URL Preferences'][] values all to either http or to https, and change any links in your content to use that same scheme also.
  
  If you are not defining all four $civicrm\_setting['URL Preferences'][] values in civicrm.settings.php, then those values are instead defined at Administer | System Settings | Resource URLs. While there, verify that the value of "Force Secure URLs (SSL)" is consistent with your intended scheme.
  
  > **Comments:**
  > **username_3**: I agree that this is likely.  There's a good explanation here: https://civicrm.stackexchange.com/a/3233/12  
  
  ---
  
  