I made a Login and logout page but whenever i login and press backspace i am redirected to the login page ....
what to do to prevent it from going to the login page even if i have not pressed logout option

Recommended Answers

All 3 Replies

How are you logging in? are u using $_SESSION to keep track of the login status?

if your using sessions then add something like this at the top of your login page

//make sure this is comes before any HTML codes and whitespace. 
session_start();
if(isset($_SESSION['login'])){
header('location: www.example.com');
}

Ya i did it usin sessions and cookies .....finally got it ...
Thaank You

awesome, I hoped I helped in someway. please mark this thread as solved if you're all good with this discussion.

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.