Forum Moderators: coopster
After that the session is destroyed. My problem is that if i press the button "Back" here , i will be able to see the content of the previous page. I dont't like it! Have i done something wrong? Can i do something to prevent the user of seeing the main page after loged out? (the ideal would be to get him to the login page again)
Thank you
If the page is cached there isn't really much you can do if they go back. If you are already authenticating the user on each page and it still shows then you are kind of stuck.
You can send no-cache headers but even then it may still show the page on Back. At least if they try to go anywhere from there they will be thrown back to the login page.
When they logout do you send them off to the login page now?
for example if you store username and accountid in the session and need them to be there all the time. On each page you can include a base auth like so
<? include "/mylibs/auth.php";?>
auth.php
<?
if (!isset($_SESSION['username']) ¦¦!isset($_SESSION['account_id'])) {
unset($_SESSION);
header("Location: /login.php");
}
something like that