Status message

Maintenant, vous regardez: Session-Related Settings

Session-Related Settings

There are three places where Drupal modifies session-handling settings: in the .htaccess file, in the
settings.php file, and in the bootstrap code in the includes/ file.

1. In .htaccess
Drupal ensures that it has full control over when sessions start by turning off PHP’s session.auto_start
functionality in the Drupal installation’s default .htaccess file with the following line:
php_flag session.auto_start false
session.auto_start is a configuration option that PHP cannot change at runtime, which is why it
lives in the .htaccess file instead of settings.php.

2. In settings.php
You’ll set most session settings within the settings.php file, located at sites/default/settings.php or

  1. ini_set('session.gc_probability', 1);
  2. ini_set('session.gc_divisor', 100);
  3. ini_set('session.gc_maxlifetime', 200000);
  4. ini_set('session.cookie_lifetime', 2000000);

Having these settings in settings.php instead of .htaccess allows subsites to have different settings and
allows Drupal to modify the session settings on hosts running PHP as a CGI (PHP directives in .htaccess
don’t work in such a configuration).
Drupal uses the ini_set('session.save_handler', 'user'); function to override the default session
handling provided by PHP and implement its own session management; user-defined in this context
means “defined by Drupal” (see

3. In
Session settings included in are:

  1. ini_set('session.use_cookies', '1');
  2. ini_set('session.use_only_cookies', '1');
  3. ini_set('session.use_trans_sid', '0');
  4. // Don't send HTTP headers using PHP's session handler.
  5. ini_set('session.cache_limiter', 'none');
  6. // Use httponly session cookies.
  7. ini_set('session.cookie_httponly', '1');

PHP provides built-in session-handling functions but allows you to override those functions if you
want to implement your own handlers, such as storing sessions in memcache or MongoDB instead of
MySQL. PHP continues to handle the cookie management, while Drupal’s implementation does the
back-end handling of session storage.
The call to drupal_session_initialize() during the DRUPAL_BOOTSTRAP_SESSION phase of
bootstrapping sets the handlers to functions in includes/ and starts session handling:

  2. require_once DRUPAL_ROOT . '/' . variable_get('session_inc',
  3. 'includes/');
  4. drupal_session_initialize();
  5. break;

The drupal_session_initialize() function within sets the handlers to the following values:

  1. session_set_save_handler('_drupal_session_open', '_drupal_session_close',
  2. '_drupal_session_read', '_drupal_session_write', '_drupal_session_destroy',
  3. '_drupal_session_garbage_collection');

Notice that the file being included in is defined by a Drupal variable named
session_inc. This means that you can cleanly implement your own session handling and plug in that
instead of using Drupal’s default session handling.
For example, the memcache module ( implements the

  1. _drupal_session_open(), _drupal_session_close(),
  2. _drupal_session_read(), _drupal_session_write(), _
  3. drupal_session_destroy(), _drupal_session_garbage_collection()

session-related functions. Setting the session_inc Drupal
variable causes Drupal to use this code for sessions instead of using default session handling:

  1. 'session_inc' => './sites/all/modules/memcache/',

You could also override the variable by setting it in your settings.php file:

  1. $conf = array(
  2. 'session_inc' => './sites/all/modules/memcache/,
  3. ...
  4. );


Comments canadian pharmacies without an rx
canadian pharmaceuticals stocks
is trust pharmacy in canada legitimate canada medication pharmacy
canada medications cheap
reputable canadian prescriptions online canada pharmaceuticals online
best canadian pharmacies online
canadian government approved pharmacies canadian pharmacy king
canada pharmaceuticals online
safe canadian online pharmacies canada online pharmacy
canada pharmacies account
canadian pharmacy cialis aarp recommended canadian pharmacies
drugs for sale deep web
canadian mail order pharmacies canadian online pharmacies rated
order canadian prescriptions online
drugstore online canada canada online pharmacies medication
northwest pharmacies online
cialis canadian pharmacy pharmacy canada online prescriptions
drugstore online shopping reviews
canadian drugstore canadian rx world pharmacy
online canadian discount pharmacies
northwest pharmacies mail order canadian rxlist
the best canadian online pharmacies
canadian pharmacies stendra canadian prescriptions online serc 24 mg
canadian pharmacy meds
online pharmacies of canada canadian pharmacy no prescription
pharmacy canada online prescriptions
canada drug canadian pharcharmy online
most reliable canadian online pharmacies
canadian mail order pharmacies online pharmacies legitimate
canada medication prices
canada medication list canadian pharmacy cialis
best canadian mail order pharmacies
canadian discount pharmacies in canada canada pharmacies online prescriptions
best canadian pharmacy
canadian pharmacy online 24 canadian pharmaceuticals stocks
canadian pharmacies without an rx
north west pharmacy canada canadian medications list
the best canadian online pharmacies
online pharmacies in usa

I will right away seize your rss feed as I can not in finding your email subscription link or newsletter service.

Do you have any? Kindly permit me understand in order that I could subscribe.


antinomians (Alisha) pharmacy canada plus
canada medication pharmacy
canadian prescriptions online canadian pharmacies that ship to us
canadian mail order pharmacies
good canadian online pharmacies northwest pharmacy canada
canadian pharmacycanadian pharmacy
drugs for sale on internet canadian pharmaceuticals
is trust pharmacy in canada legitimate
canadian medications 247 canadian prescriptions online
canada vagra
good canadian online pharmacies trust pharmacy canada reviews
pharmacy canada online prescriptions
canadian pharmacy canadianpharmacyusa24h
online pharmacies in usa
canada pharmaceuticals online canadian rxlist
canada pharmacies online prescriptions
online canadian pharmacy


Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
2 + 11 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.