Page 1 of 1
login issue
Posted: Sat Dec 26, 2009 2:48 am
by furqankhan
hi all ,
i am new to php. i am developing admin site where users may log in by loginid and password. i am managing this by session but when the user log out from admin site if the browser back button is pressed. it again goes to the admin page. how ever if i close the browser and try again it works fine
Re: login issue
Posted: Sat Dec 26, 2009 5:31 am
by jhack
I think you are not destroying the session correctly
And also you should check is the session variable is set at the top of each page which requires login.
Code: Select all
session_start(); // start the session
if( !isset($_SESSION['user'])) // check the session variable is set
// redirect to the login page
Re: login issue
Posted: Sat Dec 26, 2009 5:52 am
by kaisellgren
The web browser probably cached the admin page. So, when you pressed the back button, it did not even request your page, it fetched it from the RAM.
Re: login issue
Posted: Fri Jul 30, 2010 4:18 am
by anilnakkani
Hi,
After Logout.You need to check whether user session expired or not. if not expired need to move to that file to index,otherwise browser back button problem will come...
Thanks
Anil.N
Thought Radius - Experts for Partners
Re: login issue
Posted: Sat Jul 31, 2010 7:38 am
by Bind
Additionally, when setting cookies on a page that redirects (like after a login/logout), the cookie must be set after the header()'s, else the cookie change may not stick.
example:
Code: Select all
<?php
header('Location: http://www.example.com/');
setcookie ("TestCookie", "", time() - 3600, "/", "example.com", 1);
?>
Re: login issue
Posted: Mon Sep 13, 2010 5:59 am
by vishal5085
The seesion is not destroyed.
so use this code
if(isset($submit))
{
session_destroy();
}
session_destroy() fonction will destroy ur session.
it worked for my website. so i think for ur website also it worked.