In the manual, I read:

PHP needs the following configuration directives for drupal to work:
session.save_handler: user
In addition, we recommend the following settings:
session.cache_limiter: none
(We only mention directives that differ from the default php.ini-dist / php.ini-recommended starting with PHP 4.0.6)
These settings are contained in the default .htaccess file that ships with Drupal,

I forgot to change my php.ini. So, I've had "session.save_handler = files" for a whie now.
A few notes:

* I'm using cvs

* I don't use the .htaccess. I put the directives in httpd.conf instead. As far as PHP, I can only see:

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0

* My "session" table is full to the brim. So, it's not using "files" after all...!

So... am I missing something? Is trupal forcing PHP to use DB sessions somehow? If so, is the manual page outdated?

There have been some posts about it on the forums (including an horror one, where the user information in the user table).

Can anybody give us a definite answer to this?




erdemkose’s picture

Drupal tells PHP that Sessions will be handled by custom functions. This happens in two steps.

  1. Drupal sets session.save_handler='user' in sites/default/settings.php
    Line 116-126
    ini_set('arg_separator.output',     '&');
    ini_set('magic_quotes_runtime',     0);
    ini_set('magic_quotes_sybase',      0);
    ini_set('session.cache_expire',     200000);
    ini_set('session.cache_limiter',    'none');
    ini_set('session.cookie_lifetime',  2000000);
    ini_set('session.gc_maxlifetime',   200000);
    ini_set('session.save_handler',     'user');
    ini_set('session.use_only_cookies', 1);
    ini_set('session.use_trans_sid',    0);
    ini_set('url_rewriter.tags',        '');
  2. Tells PHP the names of functions in includes/bootstrap.inc
    Line 700: session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc");
erdemkose’s picture

I forgot to say that custom session functions of Drupal are located in includes/session.inc.

<signature owner="erdemkose">
  <description>This site is working with text files. Thanks to PHP-TXT-DB. You may download a copy of php-txt-db database layer for Drupal. There are bugs, incompatibilities but it is a good experiment.</description>

mercmobily’s picture


In this case, is ti safe to say that the manual is indeed outdated?