session start Options
suggest changeAs 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
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents