CripDawg Posted April 12, 2015 Share Posted April 12, 2015 i am watching a youtube tutorial for a register and login page the register and login parts work fine but once the user is logged in the logout button will not work it won't delete the session but if i delete the session using the inspect element of my browser and refresh the page the user will be logged out but the button will not work. here is the youtube part I'm up to. would like to continue with these parts once this problem is fixed I've tried a few debugging methods that you will see in my code witch there is a lot of but i think its all worth showing because the functions go across different files. index.php <?php require_once 'core/init.php'; if(Session::exists('home')) { '<p>' . Session::flash('home') . '</p>'; } $user = new User(); if($user->isLoggedIn()) { ?> <p>Hello <a href="#"><?php echo escape($user->data()->username); ?> </a></p> <ul> <li><a href="logout.php">Log out</a></li> </ul> <?php } else { echo '<p>You need to <a href="login.php">Log In</a> or <a href="register.php">Register</a></p>'; } Quote Link to comment https://forums.phpfreaks.com/topic/295469-object-orientated-logout-button-problem/ Share on other sites More sharing options...
ginerjm Posted April 12, 2015 Share Posted April 12, 2015 Did you ever hear of a period when writing English? And what does orientated mean? Are you referring to oriented or are you referring to orientation? Quote Link to comment https://forums.phpfreaks.com/topic/295469-object-orientated-logout-button-problem/#findComment-1508844 Share on other sites More sharing options...
maxxd Posted April 12, 2015 Share Posted April 12, 2015 Your log out link goes to logout.php, but you've only shown us the code for index.php. The problem would be in the logout.php script (as that's where the browser is going once the link is clicked), so show us that code as well. Quote Link to comment https://forums.phpfreaks.com/topic/295469-object-orientated-logout-button-problem/#findComment-1508855 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.