Did you try to install Magento 2.3.6-p1?
And faced an error after installing the Magento version 2.3.6-p1 that looks something like this:
report.ERROR: Failed to set ini option “session.cookie_samesite” to value “Lax”.
If yes, relatable!
Because I’ve also faced the same error. To save you from all the process I went through to find the solution to Failed to Set ini Option “session.cookie_samesite” to Value “Lax” in Magento 2.3.6-p1, I have posted it here.
This error occurs due to the lower PHP version you may be using.
Solution for Failed to Set ini Option “session.cookie_samesite” to Value “Lax” in Magento 2.3.6-p1
PHP 7.3 or above version is a must to solve this error!
So check if your version of PHP is 7.3 or above. If not, set PHP 7.3 or above version.
However, I have another solution for this error if you don’t want to change your PHP version.
Use the below code in your SessionManager.php file located at vendor\magento\framework\Session\
private function initIniOptions()
{
$result = ini_set('session.use_only_cookies', '1');
if ($result === false) {
$error = error_get_last();
throw new \InvalidArgumentException(
sprintf('Failed to set ini option session.use_only_cookies to value 1. %s', $error['message'])
);
}
foreach ($this->sessionConfig->getOptions() as $option => $value) {
if ($option === 'session.cookie_samesite') {
continue;
}
if ($option == 'session.save_handler') {
continue;
} else {
$result = ini_set($option, $value);
if ($result === false) {
$error = error_get_last();
throw new \InvalidArgumentException(
sprintf('Failed to set ini option "%s" to value "%s". %s', $option, $value, $error['message'])
);
}
}
}
}
However, it is not recommended to apply changes in the default file of Magento. So it is better to use PHP version 7.3 or above.
That’s all!
Feel free to share the solution with Magento Community via social media.
Thank You.