only secure cookies when using https

This commit is contained in:
Eric Schultz
2019-09-06 13:37:03 -05:00
parent b4a60ddf73
commit facb1fbe86
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
session_set_cookie_params(0, '/', strstr($_SERVER['HTTP_HOST'].':', ':', true), true, true);
session_set_cookie_params(0, '/', strstr($_SERVER['HTTP_HOST'].':', ':', true), array_key_exists('HTTPS', $_SERVER), true);
session_start();
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';