Body: <p>I am using CiviCRM 5.23.4 with Drupal 7.69, though this issue is not new to this version of Civi.</p>
  
  <p>Every time Civi cron runs, I get a warning in the Drupal Recent log messages:</p>
  
  <p>Warning: session_set_save_handler(): Cannot change save handler when session is active in drupal_session_initialize() (line 242 of /home/XXXX/www/www/includes/session.inc).</p>
  
  <p>Any suggestions for how to address this would be appreciated. Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-25T18:32:49.937Z
Comments.Text: What version of php? Not the one listed at /admin/reports/status but the one that cron actually uses. If you aren't sure put `watchdog('test', phpversion());` in line 241 in includes/session.inc and then check what it puts in the drupal log.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-25T20:44:56.593Z
Comments.Text: Good question. 7.2.28
Comments.UserDisplayName: The Amateur
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-25T20:56:28.493Z
Comments.Text: That should be ok, and in fact you maybe started seeing the messages whenever you started with php 7.2. Anything session-related in civicrm.settings.php? Or an extension? Although it seems like that line would run earlier before civi starts. I guess you don't see the message when it's just regular drupal cron running?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-25T21:04:48.173Z
Comments.Text: Thanks for helping me out with this Demerit. It only happens when Civi cron runs, not when drupal cron runs. I wouldn't know what to look for in terms of "anything session-related". And I'm also not sure what you mean about extensions. Sorry, I'm an amateur with this stuff :-)
Comments.UserDisplayName: The Amateur
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-25T21:14:05.843Z
Comments.Text: For extensions I mean in civicrm under Administer - System Settings - Manage Extensions. But my guess right now is that it's not actually drupal 7.69 and is maybe only partially upgraded and maybe still has files from 7.67? Or a non-standard drupal module is causing it, on the drupal side under admin - modules. Except then you would probably see it for drupal cron, but maybe civi causes an extra call or something. I'm not really sure here.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-25T21:20:02.513Z
Comments.Text: Oh yes, I am using a number of Civi extensions and many Drupal modules. I keep everything up to date carefully so there shouldn't be any 7.67 files lying around. So should I disable extensions and test?
Comments.UserDisplayName: The Amateur
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-25T21:27:36.857Z
Comments.Text: Disabling and testing is one way. If any are about login or session management they would be obvious ones to check first.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-25T21:36:27.303Z
Comments.Text: None of the Civi extensions are concerned with session management as far as I can tell, but maybe some Drupal modules. I'll do a bit of testing. Thanks for your help.
Comments.UserDisplayName: The Amateur
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-14T23:49:49.413Z
Comments.Text: I tested by disabling all Civi extensions and running cron, but the same issue occurs. And since it does not happen when Drupal cron runs, I did not try disabling the many Drupal extensions. None is concerned with session handling as far as I can tell. Anyone have any other suggestions?
Comments.UserDisplayName: The Amateur
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-13T19:59:53.137Z
Comments.Text: Getting this same error (Drupal 7.87, CiviCRM 5.46.0) Sure would like to find the answer
Comments.UserDisplayName: Stephen Sloan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-16T21:08:01.787Z
Comments.Text: I continue to have this issue with Civi 5.46.2, PHP 7.4 and Drupal 7.87, so I'm afraid I can't offer any new insights.
Comments.UserDisplayName: The Amateur
Tags: <drupal><cron>
Title: Why is there a "session_set_save_handler" warning whenever Civi cron runs?
ThreadText: # Why is there a "session_set_save_handler" warning whenever Civi cron runs?
  
  (Asked by: username_0 on 2020-03-25)
  
  I am using CiviCRM 5.23.4 with Drupal 7.69, though this issue is not new to this version of Civi.
  
  Every time Civi cron runs, I get a warning in the Drupal Recent log messages:
  
  Warning: session\_set\_save\_handler(): Cannot change save handler when session is active in drupal\_session\_initialize() (line 242 of /home/XXXX/www/www/includes/session.inc).
  
  Any suggestions for how to address this would be appreciated. Thanks.
  
  **Tags:** drupal, cron
  
  > **Comments:**
  > **username_1**: What version of php? Not the one listed at /admin/reports/status but the one that cron actually uses. If you aren't sure put `watchdog('test', phpversion());` in line 241 in includes/session.inc and then check what it puts in the drupal log.  
  > **username_0**: Good question. 7.2.28  
  > **username_1**: That should be ok, and in fact you maybe started seeing the messages whenever you started with php 7.2. Anything session-related in civicrm.settings.php? Or an extension? Although it seems like that line would run earlier before civi starts. I guess you don't see the message when it's just regular drupal cron running?  
  > **username_0**: Thanks for helping me out with this username_1. It only happens when Civi cron runs, not when drupal cron runs. I wouldn't know what to look for in terms of "anything session-related". And I'm also not sure what you mean about extensions. Sorry, I'm an username_0 with this stuff :-)  
  > **username_1**: For extensions I mean in civicrm under Administer - System Settings - Manage Extensions. But my guess right now is that it's not actually drupal 7.69 and is maybe only partially upgraded and maybe still has files from 7.67? Or a non-standard drupal module is causing it, on the drupal side under admin - modules. Except then you would probably see it for drupal cron, but maybe civi causes an extra call or something. I'm not really sure here.  
  > **username_0**: Oh yes, I am using a number of Civi extensions and many Drupal modules. I keep everything up to date carefully so there shouldn't be any 7.67 files lying around. So should I disable extensions and test?  
  > **username_1**: Disabling and testing is one way. If any are about login or session management they would be obvious ones to check first.  
  > **username_0**: None of the Civi extensions are concerned with session management as far as I can tell, but maybe some Drupal modules. I'll do a bit of testing. Thanks for your help.  
  > **username_0**: I tested by disabling all Civi extensions and running cron, but the same issue occurs. And since it does not happen when Drupal cron runs, I did not try disabling the many Drupal extensions. None is concerned with session handling as far as I can tell. Anyone have any other suggestions?  
  > **username_2**: Getting this same error (Drupal 7.87, CiviCRM 5.46.0) Sure would like to find the answer  
  > **username_0**: I continue to have this issue with Civi 5.46.2, PHP 7.4 and Drupal 7.87, so I'm afraid I can't offer any new insights.  
  
  ---
  
  ## 0 answers
  
  