Jump to content

logout and self-submission needs reload


sjk1000

Recommended Posts

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

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. 

 

 

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 ();
}
?>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.