session start Options

suggest change

As of PHP 7.0, session_start() accepts an array of session php.ini options.

Example

<?php
   if (version_compare(PHP_VERSION, '7.0.0') >= 0) {
       // php >= 7 version
       session_start([
          'cache_limiter' => 'private',
          'read_and_close' => true,
       ]);
   } else {
       // php < 7 version
       session_start();
   }
?>

This feature also introduces the php.ini setting session.lazy_write, which defaults to true, so session data is rewritten only when it changes.

Referencing: https://wiki.php.net/rfc/session-lock-ini

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents