The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
$_SESSION are set twice - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: $_SESSION are set twice (/showthread.php?tid=1033)



$_SESSION are set twice - AnasAZ - 04-12-2018

Hi,

When you use
Code:
print_r(get_defined_vars());
in a standard page, you get all $_SESSION variables are set twice, if that a bug?

I have this test.php page under US root folder:

Code:
<?php require_once 'users/init.php'; ?>
Code:
<?php require_once $abs_us_root.$us_url_root.'users/includes/header.php'; ?>
Code:
<?php require_once $abs_us_root.$us_url_root.'users/includes/navigation.php'; ?>
Code:
<?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
Code:
<?php
Code:
echo "<pre>";
Code:
print_r(get_defined_vars());
Code:
echo "</pre>";
Code:
?>
Code:
<!-- footers -->
Code:
<?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>


now I can see the following SESSION variables two times:

[_data:User:private] => stdClass Object
[_SERVER] => Array
.... and so on


$_SESSION are set twice - Brandin - 04-12-2018

Can you give us an output please?


$_SESSION are set twice - AnasAZ - 04-12-2018

I noticed the first set are defined as an array:

Code:
Array
<pre>
Code:
(
    [_GET] => Array
        (
        )
</pre>


` [_POST] => Array
(
)`

` [_COOKIE] => Array
(
[_ga] => GA1.2.124111111.1490711111
[__hstc] => 194989682.aeb17941acb2b73a13111111111.1490701606726.14979491111111.149809511111.13
[hubspotutk] => aeb17941acb2b1111111ab08c7c73
[PHPSESSID] => hn652plgg2p611111111111nnviim0
)`

and the other set defined as GLOBALS

Code:
[GLOBALS] => Array
` (
[_GET] => Array
(
)`

` [_POST] => Array
(
)`

`[_COOKIE] => Array
(
[_ga] => GA1.2.124111111.1490711111
[__hstc] => 194989682.aeb17941acb2b73a13111111111.1490701606726.14979491111111.149809511111.13
[hubspotutk] => aeb17941acb2b1111111ab08c7c73
[PHPSESSID] => hn652plgg2p611111111111nnviim0
)`

Is this normal?