Browser back button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dumlee
Forum Commoner
Posts: 33
Joined: Mon Jun 30, 2008 12:06 am

Browser back button

Post by dumlee »

how to control browser back button in case we are destroying session when user clicks on Logout option.

Currently the users who are logged in and log out from there account ther are directed to login page.BUt if they press Browser back button then they are able to do all operations which they r not authorised to do without logging in.

Pls help.

its urgent.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: Browser back button

Post by JAB Creations »

The issue is not the client but the server code. You need to always check for the member $_SESSION for all member-only functionality at the server.

So in essence the logic is...

if (logged in) {do stuff}
else {throw an error message}
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Browser back button

Post by RobertGonzalez »

And for the record, please do not mention that your issue if urgent. All of the posts here are urgent. Telling us yours is urgent is not going to make anyone want to help you any faster.
Post Reply