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

FernanditosAsked:
Who is Participating?
 
Lukasz ChmielewskiCommented:
Show the other page code.
Is it just
<?php
session_start();
echo $_SESSION['logged'];
?>

I guess not...
0
 
psimationCommented:
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?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.