sjk1000 Posted December 6, 2008 Share Posted December 6, 2008 Hi all I've a logout button that runs a function to destroy the session and then return to the same page. I think the position of the menu function in the script is preventing it from returning again to the login prompt. A page reload at this point instantly deals with it. I'd rather not rework the flow of the script because this is the last thing I'm doing on the page. How do I force the browser to reload? Thanks, Steve Link to comment https://forums.phpfreaks.com/topic/135777-logout-and-self-submission-needs-reload/ Share on other sites More sharing options...
redarrow Posted December 6, 2008 Share Posted December 6, 2008 <?php ob_start() << //biginig of page ob_flush() << end of page Link to comment https://forums.phpfreaks.com/topic/135777-logout-and-self-submission-needs-reload/#findComment-707514 Share on other sites More sharing options...
sjk1000 Posted December 6, 2008 Author Share Posted December 6, 2008 Ah. That has some interesting effects If I'm reading the descriptions right, the ob_ functions suspend output until you're ready to dump or deal with it. This worked partially but the function that displays the members menu was called earlier and I also need to remove that. Makes me think that my logout still needs to force a reload. Link to comment https://forums.phpfreaks.com/topic/135777-logout-and-self-submission-needs-reload/#findComment-707544 Share on other sites More sharing options...
sjk1000 Posted December 6, 2008 Author Share Posted December 6, 2008 OK I've solved the problem but I don't understand how. I did it by calling the seller_logout function from within itself which has a similar effect to refreshing the page - [insert mixed emotions smiley here]. Can someone explain why this works? Thanks, Steve <?php function seller_logout() { unset($_SESSION['valid_user']); session_destroy(); seller_logout (); } ?> Link to comment https://forums.phpfreaks.com/topic/135777-logout-and-self-submission-needs-reload/#findComment-707568 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.