Jump to content

problem in logout function?


phpmady

Recommended Posts

Hi,

 

 

I am using the following for log out calling, when it is internet explorer no problem for me, but when coming to mozilla , its behaving dirently, nothing is happening in mozilla, whats the problem?

 

 

if ($_REQUEST['do'] == 'login_out')
{
unset( $_SESSION['admin_Usernamee']); 
unset( $_SESSION['admin_Passwordd']); 
session_destroy(); 
echo "<meta http-equiv=Refresh content=0;url='index.php'>";
}

 

 

Thanks,

Link to comment
https://forums.phpfreaks.com/topic/203081-problem-in-logout-function/
Share on other sites

The browser shouldn't have any effect on the code as it's all server sided. The only problem i can think of with this is that 'login_out' is being passed in differently. Try echoing what is stored in $_REQUEST['do'] and check if it is actually passing through properly.

 

Also

 

echo "<meta http-equiv=Refresh content=0;url='index.php'>";

 

should be

 

echo "<meta http-equiv='Refresh' content='0;url=index.php' />";

The browser shouldn't have any effect on the code as it's all server sided. The only problem i can think of with this is that 'login_out' is being passed in differently. Try echoing what is stored in $_REQUEST['do'] and check if it is actually passing through properly.

 

Also

 

echo "<meta http-equiv=Refresh content=0;url='index.php'>";

 

should be

 

echo "<meta http-equiv='Refresh' content='0;url=index.php' />";

 

But no problem in ie, thats why it must be the browser problem

Did you try replacing the meta tag? .. the syntax was wrong in it. It was missing quotes etc. It looks like the PHP is fine so it's most likely logging them out in firefox but not redirecting them due to the broken meta tag.

 

Hi ,

 

I found the bug, actually meta refresh is a deprecated one, its not supported by mozilla firefox, instead of that we can still do the same functionality redirecting using the header function in php.

 

I simply change it to:

 

header("Location:index.php");

 

Thanks for you help

 

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.