FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Does it Happen to you? What is the solution? --- PHP problem





imagefree
I have made a login system for a site. Its working fine, but there is a problem in logout.


When i logout, it logouts me but on clicking back button in the browser window, it takes me back to the logged in page and when i hit refresh, the page is refreshed in front of me and in the refreshed page i am logged in Shocked


I tried it on Frihost (i mean phpbb) but its perfectly working here so there is no browser problem involved in it. What/Where the problem whould be?


Here is the link http://linkbase.uni.cc/

You may register and then logout and then click back and refresh and see what happens.

Hopping replies!
Thanks
Peterssidan
I registered to see what it could be but it was no problem for me. If I log out and pres previous I will go to the previous page but I'm not logged in.

Another thing I noticed was that members.php It looks like I not logged in even if I am.
Diablosblizz
Yes, no problems here. Though, in your setprofile.php it goes to the account with the username of hamdusa. There is a problem with that so you may need to fix that.

Kind regards.
alalex
if you have cache enables it might be that, although it is not very probable. If other people didn't have that problem then it may not be a problem with your code, but if you want you can post the logout code here and we'll look for errors Wink
imagefree
Code:
<?php
if(isset($_GET['action']))
{
   if($_GET['action']=='logout')
   {
      unset($_SESSION['username']);
      unset($_SESSION['password']);
      setcookie("username", "", time()-60*60*24*100, "/");
      setcookie("password", "", time()-60*60*24*100, "/");
      
   }
   
}
?>


This is a file named logout.ini and i include this file in each and every major file (publicly accessible, like index.php etc). And if anyone clicks on logout (URL: http://linkbase.uni.cc/page.php?action=logout) this GET veriable is checked in the included file.

Do the code need redirection too? So that cookies are properly deleted.
Also comment on this type of Logout (Using GET instead of making a separate logout.php file)


Quote:
Another thing I noticed was that members.php It looks like I not logged in even if I am.

Yes just TWO pages are working index.php and register.php
THanks

Quote:
Yes, no problems here. Though, in your setprofile.php it goes to the account with the username of hamdusa. There is a problem with that so you may need to fix that.


Very Happy I handcodded it!. The whole page of setprofile.php is handcoded. I just uploaded the site to show my cousin the layout (i am developing this site for my cousin who want this site to be removed from MSN Groups and recognized as a fullfledge site)


Thank you all.
snowboardalliance
alalex wrote:
if you have cache enables it might be that, although it is not very probable. If other people didn't have that problem then it may not be a problem with your code, but if you want you can post the logout code here and we'll look for errors Wink


I'm guessing it is the cache as you have described the problem (I didn't test it though). Check to see if that is the problem.
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.