09-17-2017, 10:30 PM
I've been digging through the CI3.1.5 Session.php file, and come across this:
And then see that PHP has a runtime config "session.lazy_write" which is described as:
Which seems like if set to 0 might be similar for PHP 7.0+. Am I wrong? Is the behavior of lower versions always lazy, and that's why the work-around exists? I'm just kind of curious as to why the work-around or non-lazy writing would be desirable. What's the reason why the work-around is needed?
PHP Code:
// Another work-around ... PHP doesn't seem to send the session cookie
// unless it is being currently created or regenerated
elseif (isset($_COOKIE[$this->_config['cookie_name']]) && $_COOKIE[$this->_config['cookie_name']] === session_id())
{
setcookie(
$this->_config['cookie_name'],
session_id(),
(empty($this->_config['cookie_lifetime']) ? 0 : time() + $this->_config['cookie_lifetime']),
$this->_config['cookie_path'],
$this->_config['cookie_domain'],
$this->_config['cookie_secure'],
TRUE
);
}
And then see that PHP has a runtime config "session.lazy_write" which is described as:
Quote:session.lazy_write, when set to 1, means that session data is only rewritten if it changes. Defaults to 1, enabled.
Which seems like if set to 0 might be similar for PHP 7.0+. Am I wrong? Is the behavior of lower versions always lazy, and that's why the work-around exists? I'm just kind of curious as to why the work-around or non-lazy writing would be desirable. What's the reason why the work-around is needed?