I have a CiviCRM database on a Drupal CMS using a MySQL database. I'm having problems because users keep getting logged out. First thoughts/suggestions were related to being switched between http/https, or perhaps related to Drupal modules. I've discounted all of these.

However, when I tried to deliver training to the new users (we're due to go live on 3rd April!), it only seemed to log us out when we were trying to write to the database, e.g. creating new contacts or events. Also, for a handful of contacts I hit an error when I try to view their events, but this is fine for the majority. The events were imported directly to the database using phpMyAdmin, rather than the UI in CiviCRM.

Is it possible that there's an issue with the database? I'm using MySQL v5.7.

I'm totally out of ideas and I really need to fix this!

  • I have asked this on the CiviCRM SE civicrm.stackexchange.com/questions/17520/… – Rose Lanigan Mar 23 '17 at 18:17
  • Anything is possible. What troubleshooting have you done so far? What constitutes a "logged in user" vs. a "logged out user" in the database? – mustaccio Mar 23 '17 at 20:22
  • Have you verified system time values, that db server and web system time are the same. also check default php session timeouts. ini_set('session.cookie_lifetime', 2000000); – jozwikjp Mar 24 '17 at 2:54
  • Only troubleshooting so far is in CiviCRM and Drupal - I've uninstalled all additional modules and extensions. I've returned to the default settings for the behaviour around http/https so that it doesn't cause errors. – Rose Lanigan Mar 24 '17 at 11:02
  • I do change the cookie lifetimes to 0 so that the user is logged out when the browser is closed. This usually works fine. I'll return that to the default. and see if that helps. – Rose Lanigan Mar 24 '17 at 11:03

You cannot assume that a user stays logged in forever. Glitches occur everywhere, especially in networks. You must code to recover from such.

When running in a browser, each page is necessarily a separate database connection. Code accordingly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.