Link to home
Start Free TrialLog in
Avatar of Fernanditos
Fernanditos

asked on

Sessuin Variable access - Question

Hi,

I have the attached code which is working fine and print the right Session value.

the problem is when I try to access to the session value from another page on my site:

<?php echo $_SESSION['logged']; ?> always return YES. even if the value is NO.

What is wrong here?
<?php

session_start();

include('/home/eagle/public_html/board/global.php');

if($vbulletin->userinfo['userid'] > 0){

      $_SESSION['logged'] = 'yes';

}   ELSE {    
      $_SESSION['logged'] = 'no';    }
?>


<?php echo $_SESSION['logged']; ?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Lukasz Chmielewski
Lukasz Chmielewski
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
show us an example of the "other" page where you are trying to access the  session var. Do you also have a session_start() on that page?