× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$_SESSION are set twice
#1
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
  Reply
#2
Can you give us an output please?
  Reply
#3
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?
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)