Hi
I am facing problem with back button .. Even though i am able to destroy session my back button gets me to the check page .. here 2.php .How should i prevent this here is the code
in.html
<html>
<body>
<form action=in.php method=post>
<input type = text name=username>
</form>
</body>
</html>
in.php
<?php
session_start();
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-control: private"); //IE bug Fix
$user1 = $_REQUEST['username'];
$_SESSION['name']=$user1;
echo'welcome',$_SESSION['name'];
echo '<a href=out.php>logout</a>';
echo '<a href=2.php>2nd page</a>';
?>
2.php
<?php
session_start();
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-control: private"); //IE bug Fix
if(!@$_SESSION['name'])
header("location: out.php");
echo'Hello',$_SESSION['name'];
echo '<a href=out.php>logout</a>';
?>
out.php
<?php
session_start();
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-control: private"); //IE bug Fix
$_SESSION['name']=FALSE;
$_SESSION = array() ;
session_destroy();
echo'welcome guest';
?>
After clicking logout i can go back to 2.php using back button .How to avoid this ..Please help.. thanks in advance