Hi Every one!
I am developing an intranet php application using IIS server with PHP and MySql database. In my application when user login to the system, after authentication I will send the user to a welcome page by using header function by sending a unique session id for that user which i have generated and saved in the database, Following is the code how I use the header function.
PHP Code:
if($my_personal_profile["staffType"]=="admin")
{
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
$toGo = $CFG["wwwroot"]."admin/"; // *with* an ending "/"
header ("Location:".$toGo."welcome.php?session=$session&staffLevel=$userAccessLevel");
}
and on the welcome page I will take the session value and check if the user has logged in or not. If session does not exist I will send the user to the login page
PHP Code:
$session = $_GET['session'];
if(!(require_login($session)))
{
$toGo = $CFG["wwwroot"]."login.php";
header ("Location:".$toGo);
die;
}
My Problem is even though the user is logged in user will be sent back to the login page, it seems to be a problem with the caching
Any Body has any idea how to getover this problem please give me your ideas.