Hi to all,

page1 -- login page
page2 -- secured page 1

No Problem, If user logged out successfully using logout button. session ends and doesn't allow user to go to secured pages.
But...
Problem, if user press backspace or back button in browser staying in page2, directed to page1(login page) without logged out and again if user press forward button, redirected to again page2(secured page) with out login...

help me to solve this problem... Thanx in Advance...

Put code at the top of page to check and see if the user is still logged in. If not, then you redirect to login page.

Its that simple.

<?php
if(isset($_SESSION['User'])) {
  header("Location: login.php");
  exit;
}
// rest of your code here.

Like Keith says... it's that simple.

Things Getting Done...!

Thank you to kkeith29 & Atli...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.