Hi, some one said me the problem of getting 'web page has exired' is from session and he said me use this code: // log out if no session if (!isset($_SESSION['UserName'])) { if (isset($_SESSION)) { while (list ($key, $val) = each ($_SESSION)) { session_unregister($key); } session_destroy(); } header("Location: ../index.php"); exit(); } PHP: and I include this code to every page using include("session.php"); but I stiil have the same problem: WEB PAGE HAS EXPIRED when I press back button of Explorer, so could some body help me !!!!!!!!!!!!! thank u 4 ur time
please, plaese ,plaese help me from this error? if I click the back button of the browser the error message display " web page has expired" and I dont know the reason?? can some one help me ???????
i don´t get what you want. Have you tried to delete your browser cache & cookies? What happen if you reload the page instead of hitting the back button?
That's because the session has closed. When you hit the back button, it goes back to the previous page as it was when it was loaded. The page has therefore, expired.
// log out if no session if (!isset($_SESSION['UserName'])) { if (isset($_SESSION)) { while (list ($key, $val) = each ($_SESSION)) { session_unregister($key); } session_destroy(); } header("Location: ../index.php"); exit(); } PHP: That's session.php? If so, add before all a session_start();
Thanks all if I reload or click the back button I get the same error, really I don't know how to delete browser cache & cookies. if I submit a form to another page and I need to back the page of form by clicking the back button of the browser I get " the page has expired "
thanks tjkn & Jeehan tjkn, the link u send is concerned my PC only but what I need is, when the user of web site that I created click the submit button then user need to back by clicking the back button of the browser they get message error " web page has expired". Jeehan if I press CTRL+F5 the message error disapear, but I dont like to see this message at all instead of pressing f5 or CTRL+F5 here is the code of my page session_start(); session_regenerate_id(true); if ((!isset($_SESSION['Username'])) || (empty($_SESSION['Username'])) ) { header("Location: Sign_out.php"); exit(); } PHP: every page of my web site that containe this code -by including of writing at top of the page - will display error message (web page has expired) if I press back button of the browser. So is there somthin wrong in this code ?? please, please help me !!!!!!!!!!!!!!!!!!