jandrews3 Posted August 22, 2009 Share Posted August 22, 2009 I have a logout button on my website for my students which clears (unset) the variable $_SESSION['student'] and then sends the student to the home page (which doesn't require a password). I want to prevent another student from sitting down to the computer and clicking on the back button to see information the previous student had been doing. Is this possible? At this point, the first student is properly logged out. If another student comes and clicks back a few times but then clicks on a link, he is kicked out (because the session variable has been unset). BUT he can still view the data on the pages just prior to the previous student's logout. Boy I hope I haven't been confusing. Link to comment https://forums.phpfreaks.com/topic/171411-solved-restrict-going-backwards/ Share on other sites More sharing options...
AngelicS Posted August 22, 2009 Share Posted August 22, 2009 Hmm.. try adding this on every page: <?php if(!isset($_SESSION['student'])) { //Ask the user to login. Add forms etc. } else { //Show the page that's supposed to be seen. } ?> Best wishes //AngelicS Link to comment https://forums.phpfreaks.com/topic/171411-solved-restrict-going-backwards/#findComment-903988 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.