Advice on secure session

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Addos
Forum Contributor
Posts: 305
Joined: Mon Jan 17, 2005 4:13 pm

Advice on secure session

Post by Addos »

Hi,
I’m looking for a piece of advice regarding showing specific piece of code on different pages on my site once a user has logged in. I have no problem getting the login set up and the little bit of code I’m using on various pages to run once a person has logged in. My question is that is this secure enough as I have limited knowledge and although I have tested this a lot and its runs fine I’m nervous that as a relative beginner I could be missing something vital.

Thanks for any advice

Code: Select all

<?PHP 
if (isset($_SESSION['BB_Username']) != '') { ;
echo 'The code can run safely now’ '. '<br>';
 echo 'Hello' . ' ' .$_SESSION['BB_Username'] . '<br>' ;
}else { echo ‘Don’t run the code’  . '<br>' ; }?>

<a href="<?php echo $logoutAction ?>">Log out</a>
Post Reply