I am porting an application to Drupal. This ported application uses $_SESSION extensively.

I read the book page on Session Handler Issues, but it doesn't tell me what to do if I want to let both Drupal and my ported application use $_SESSION without conflict. Is that possible?

Rewriting my application to not use the $_SESSION variable would be a massive headache.

I don't want to drop Drupal's use of SESSION because I don't want to mess up my compatability with it (and other non-core modules).

Ideally I'd like to do something like split $_SESSION into two parts like: $_SESSION['Drupal'] and $_SESSION['Ported_Application'], however I suspect the problem is much larger than that. I suspect the problem is caused by Drupal which handles sessions with its own functions (Ex. sess_read, sess_write - listed in session.inc).

Comments

akreider’s picture

It looks like I can access the variables from my ported application in $_SESSION.

What works is to remove my regular session_start() call, and let Drupal start the session.

Before I figured that out, I somehow managed to create a 4 GB watchdog table (12 million rows) and slow my shared server down to a near grinding halt as I waited for pages to give me error messages, which never showed up. This is with Drupal 5.0 RC1. Could it be a bug or design flaw?

I'll probably be writing more about SESSIONs once I get more work done.