Page 1 of 1
prevent hit the back button
Posted: Thu Sep 09, 2004 7:08 pm
by Chriss2004
hello.
I have an admin section on my page where i use sessions.
i want to prevent the user to click on the back button of the browser.
i don't want to use cookies, and someone told me that I could use a table to store sessions. Add a dateTime or timestamp field in the table which is refresed everytime a user visits a page. Every page then checks if the user is logged in by getting the relevant record from the database and then check if the session has expired by check he date field.
I don't know how to do this.
Can sombody pls help (guide) me? I'm new to php, and this is kind of vital.
Or perhaps there are other options.
Thx
Posted: Thu Sep 09, 2004 7:14 pm
by feyd
viewtopic.php?t=23781 may help with database sessions.. try searching next time, please.
as for preventing backward walking, you can't effectively.
Posted: Fri Sep 10, 2004 9:53 am
by pickle
You could have the admin window open in a new window. When you open that window with JS, remove the toolbar which will remove the back button as well.
Posted: Fri Sep 10, 2004 10:18 am
by Weirdan
pickle wrote:You could have the admin window open in a new window. When you open that window with JS, remove the toolbar which will remove the back button as well.
well, how would you stop me from using mouse gestures?

Posted: Fri Sep 10, 2004 10:48 am
by pickle
He said he wanted to stop users from clicking the back button, nothing about mouse gestures

. No back button is better than nothing I guess.
Posted: Fri Sep 10, 2004 3:19 pm
by AngusL
It would act as a subtle hint and an incentive. What you could do of course is right your own implementation of the internet explorer engine and force admins to use that for the admin stuff.
Posted: Fri Sep 10, 2004 3:23 pm
by feyd
that's a huge waste of time Angus. All because the script isn't fault tolerant enough to handle a historic page? blech.
Posted: Fri Sep 10, 2004 3:24 pm
by hedge
umm, why don't you want them to go back?
One way that I've seen that I don't believe is actually planned is to use a page with a meta tag with a refesh of 0 before your current page.
Posted: Sat Sep 11, 2004 6:13 am
by timvw
untill now,
http://www.tonymarston.net/php-mysql/ba ... s.html#how is the easiest (and best working) solution i've seen

Posted: Sat Sep 11, 2004 6:55 am
by AGISB
You could use javascript to open a new window on each link and close the old one in the process. As you always got a new window you have no back history.
Note: You can only close windows that you opened yourself. So the initial browser window the user comes in with can't be closed.
This of course only works when javascript is enabled.