1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-07 23:27:17 +02:00

Move $HTTPS to HTTPS

This commit is contained in:
Jakub Vrana
2025-03-28 18:29:05 +01:00
parent f6d311457e
commit 74457f0895
3 changed files with 5 additions and 6 deletions

View File

@@ -323,12 +323,11 @@ function convert_fields(array $columns, array $fields, array $select = array()):
* @param int $lifetime number of seconds, 0 for session cookie, 2592000 - 30 days
*/
function cookie(string $name, ?string $value, int $lifetime = 2592000): void {
global $HTTPS;
header(
"Set-Cookie: $name=" . urlencode($value)
. ($lifetime ? "; expires=" . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT" : "")
. "; path=" . preg_replace('~\?.*~', '', $_SERVER["REQUEST_URI"])
. ($HTTPS ? "; secure" : "")
. (HTTPS ? "; secure" : "")
. "; HttpOnly; SameSite=lax",
false
);