This commit is contained in:
Marcus Hill 2022-04-24 11:50:27 +01:00
parent 76b965ec20
commit 6f4a2d0385
1 changed files with 2 additions and 6 deletions

View File

@ -333,15 +333,11 @@ function generateUserSessionKey($site_encryption_master_key){
$_SESSION['user_encryption_session_ciphertext'] = $user_encryption_session_ciphertext;
$_SESSION['user_encryption_session_iv'] = $user_encryption_session_iv;
//Give the user "their" key as a cookie
//By default, this should be HTTPS but we can change to HTTP for development via the config.php file (note that the extension won't work without HTTPS)
// Give the user "their" key as a cookie
include('config.php');
if($config_https_only){
//setcookie("user_encryption_session_key", $user_encryption_session_key, 0, "/", "", "true", "true", ['samesite' => 'None']);
setcookie("user_encryption_session_key", "$user_encryption_session_key", ['path' => '/','secure' => true,'httponly' => true,'samesite' => 'None']);
}
else{
} else{
setcookie("user_encryption_session_key", $user_encryption_session_key, 0, "/");
$_SESSION['alert_message'] = "Unencrypted connection flag set: Using non-secure cookies.";
}