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/bootstrap.inc 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
sites/example.com/settings.php.

  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 www.php.net/manual/en/function.session-set-save-handler.php).

3. In bootstrap.inc
Session settings included in bootstrap.inc 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/sessions.inc and starts session handling:

  1. case DRUPAL_BOOTSTRAP_SESSION:
  2. require_once DRUPAL_ROOT . '/' . variable_get('session_inc',
  3. 'includes/session.inc');
  4. drupal_session_initialize();
  5. break;

The drupal_session_initialize() function within session.inc 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 bootstrap.inc 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 (drupal.org/project/memcache) 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/memcache-session.inc',

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

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

Tags:

Comments

https://viagracwithoutdoctor.com/ canadian pharmacies without an rx
canadian pharmaceuticals stocks https://viagracwithoutdoctor.com/
is trust pharmacy in canada legitimate https://viagracwithoutdoctor.com/

https://viagracwithoutdoctor.com/ canada medication pharmacy
canada medications cheap https://viagracwithoutdoctor.com/
reputable canadian prescriptions online https://viagracwithoutdoctor.com/

https://viagracwithoutdoctor.com/ canada pharmaceuticals online
best canadian pharmacies online https://viagracwithoutdoctor.com/
canadian government approved pharmacies https://viagracwithoutdoctor.com/

https://viagrawwithoutdoctor.com/ canadian pharmacy king
canada pharmaceuticals online https://viagrawwithoutdoctor.com/
safe canadian online pharmacies https://viagrawwithoutdoctor.com/

https://canadianhpharmacy.com/ canada online pharmacy
canada pharmacies account https://canadianhpharmacy.com/
canadian pharmacy cialis https://canadianhpharmacy.com/

https://canadianlpharmacy.com/ aarp recommended canadian pharmacies
drugs for sale deep web https://canadianlpharmacy.com/
canadian mail order pharmacies https://canadianlpharmacy.com/

https://canadianhpharmacy.com/ canadian online pharmacies rated
order canadian prescriptions online https://canadianhpharmacy.com/
drugstore online canada https://canadianhpharmacy.com/

https://canadianlpharmacy.com/ canada online pharmacies medication
northwest pharmacies online https://canadianlpharmacy.com/
cialis canadian pharmacy https://canadianlpharmacy.com/

https://canadianhpharmacy.com/ pharmacy canada online prescriptions
drugstore online shopping reviews https://canadianhpharmacy.com/
canadian drugstore https://canadianhpharmacy.com/

https://canadianhpharmacy.com/ canadian rx world pharmacy
online canadian discount pharmacies https://canadianhpharmacy.com/
northwest pharmacies mail order https://canadianhpharmacy.com/

https://canadianhpharmacy.com/ canadian rxlist
the best canadian online pharmacies https://canadianhpharmacy.com/
canadian pharmacies stendra https://canadianhpharmacy.com/

https://viagracwithoutdoctor.com/ canadian prescriptions online serc 24 mg
canadian pharmacy meds https://viagracwithoutdoctor.com/
online pharmacies of canada https://viagracwithoutdoctor.com/

https://canadianhpharmacy.com/ canadian pharmacy no prescription
pharmacy canada online prescriptions https://canadianhpharmacy.com/
canada drug https://canadianhpharmacy.com/

https://canadianhpharmacy.com/ canadian pharcharmy online
most reliable canadian online pharmacies https://canadianhpharmacy.com/
canadian mail order pharmacies https://canadianhpharmacy.com/

https://canadianhpharmacy.com/ online pharmacies legitimate
canada medication prices https://canadianhpharmacy.com/
canada medication list https://canadianhpharmacy.com/

https://viagrawwithoutdoctor.com/ canadian pharmacy cialis
best canadian mail order pharmacies https://viagrawwithoutdoctor.com/
canadian discount pharmacies in canada https://viagrawwithoutdoctor.com/

https://canadianlpharmacy.com/ canada pharmacies online prescriptions
best canadian pharmacy https://canadianlpharmacy.com/
canadian pharmacy online 24 https://canadianlpharmacy.com/

https://viagracwithoutdoctor.com/ canadian pharmaceuticals stocks
canadian pharmacies without an rx https://viagracwithoutdoctor.com/
north west pharmacy canada https://viagracwithoutdoctor.com/

https://canadianlpharmacy.com/ canadian medications list
the best canadian online pharmacies https://canadianlpharmacy.com/
online pharmacies in usa https://canadianlpharmacy.com/

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.

Thanks.

antinomians (Alisha)

https://viagrawwithoutdoctor.com/ pharmacy canada plus
canada medication pharmacy https://viagrawwithoutdoctor.com/
canadian prescriptions online https://viagrawwithoutdoctor.com/

https://viagrawwithoutdoctor.com/ canadian pharmacies that ship to us
canadian mail order pharmacies https://viagrawwithoutdoctor.com/
good canadian online pharmacies https://viagrawwithoutdoctor.com/

https://viagracwithoutdoctor.com/ northwest pharmacy canada
canadian pharmacycanadian pharmacy https://viagracwithoutdoctor.com/
drugs for sale on internet https://viagracwithoutdoctor.com/

https://canadianlpharmacy.com/ canadian pharmaceuticals
is trust pharmacy in canada legitimate https://canadianlpharmacy.com/
canadian medications 247 https://canadianlpharmacy.com/

https://canadianhpharmacy.com/ canadian prescriptions online
canada vagra https://canadianhpharmacy.com/
good canadian online pharmacies https://canadianhpharmacy.com/

https://canadianhpharmacy.com/ trust pharmacy canada reviews
pharmacy canada online prescriptions https://canadianhpharmacy.com/
canadian pharmacy https://canadianhpharmacy.com/

https://canadianhpharmacy.com/ canadianpharmacyusa24h
online pharmacies in usa https://canadianhpharmacy.com/
canada pharmaceuticals online https://canadianhpharmacy.com/

https://viagrawwithoutdoctor.com/ canadian rxlist
canada pharmacies online prescriptions https://viagrawwithoutdoctor.com/
online canadian pharmacy https://viagrawwithoutdoctor.com/

Pages

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.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
19 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.