Skip to content

Commit 726e59d

Browse files
committed
Added session namespace
1 parent 74d48f1 commit 726e59d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

index.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
<?php
22

3+
if (!getenv('ADMINER_SESSID') && getenv('WODBY_INSTANCE_UUID')) {
4+
define('ADMINER_SESSID', str_replace('-', '', getenv('WODBY_INSTANCE_UUID')));
5+
}
6+
7+
if (!defined("SID") && getenv('ADMINER_SESSID')) {
8+
session_name("adminer_sid_" . getenv('ADMINER_SESSID')); // use specific session name to get own namespace
9+
$HTTPS = $_SERVER["HTTPS"] && strcasecmp($_SERVER["HTTPS"], "off");
10+
$params = array(0, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]), "", $HTTPS);
11+
if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
12+
$params[] = true; // HttpOnly
13+
}
14+
call_user_func_array('session_set_cookie_params', $params); // ini_set() may be disabled
15+
session_start();
16+
}
17+
318
function adminer_object() {
419

520
class AdminerSoftware extends Adminer {

0 commit comments

Comments
 (0)