Back button problem
-
Hi All... I have a login page(page1) that checks the user name and his password for a user, when the authorized user goes into the next page(page2)-I initialize an (ID session) and then when he loggs off I empty the session... but, by the back button he could return back again to the 2nd page (and this is the problem )... Could you help me.. Thanks alot... Nour
-
Hi All... I have a login page(page1) that checks the user name and his password for a user, when the authorized user goes into the next page(page2)-I initialize an (ID session) and then when he loggs off I empty the session... but, by the back button he could return back again to the 2nd page (and this is the problem )... Could you help me.. Thanks alot... Nour
All your pages should check if the user is logged in, and if not, deny access.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
Hi All... I have a login page(page1) that checks the user name and his password for a user, when the authorized user goes into the next page(page2)-I initialize an (ID session) and then when he loggs off I empty the session... but, by the back button he could return back again to the 2nd page (and this is the problem )... Could you help me.. Thanks alot... Nour
-
All your pages should check if the user is logged in, and if not, deny access.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
you can design a base class to check the session is null or not, then all the pages you use to inherit the base class
-
I did that... But what I need is not to allow the user to go back when back button is pressed... Thanks
Well, to do that, you simply need to not serve the page if the security check fails. If they are not logged in, your base page should redirect to the login page.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
Well, to do that, you simply need to not serve the page if the security check fails. If they are not logged in, your base page should redirect to the login page.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
I do that but the problem is: when an autherized user loggen in, and the logged out, he can press the back button and go again to the pages, although the sessions are empty... regards
Well, then you don't 'do that' at all. If the session is empty, then the only way they can see the page is from the cache. And there's nothing you can do about that.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
Well, then you don't 'do that' at all. If the session is empty, then the only way they can see the page is from the cache. And there's nothing you can do about that.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
I did that... But what I need is not to allow the user to go back when back button is pressed... Thanks
add following code in body tag onload="history.forward(-1);"