See http://drupal.org/node/23715 - the problem is that a user request that triggers a poormanscron run may not finish until after a subsequent user request. For example:

- user goes to homepage (as guest) starting a browser request and associated PHP session, and poormanscron starts and maybe takes a minute or more to finish

- meanwhile, user types in username/password and submits, starting a new browser request and associated PHP session. This request finishes quickly, with session.inc::sess_write() writing the logged in user id and other state to drupal's {sessions} table.

- user continues browsing the site as the authenticated user, building up session state

- at some point, poormanscron completes, and the original user session (with a guest user id and no state) completes, with sess_write() now overwriting the details keyed on PHPSESS in {sessions}

- at next request, user appears to have been logged out and loses all their session state.

To see the overlapping effect, instrument session.inc to watchdog sess_read/write calls along with the timestamp that the PHP session started.

Comments

Dave Reid’s picture

Status: Active » Fixed

Reading over the issue, I'm not sure there's much that can be helped. You had poormanscron set to run every minute, which seems unnecessary and we probably shouldn't allow it to run that frequently. You posted that once you set poormanscron to run every 10 minutes things improved significantly. So I'm going to mark this as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.