0

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...

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by nadnakinam
0

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.

Edited by somedude3488: n/a

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

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.