I am developing a web application using JSP, with Oracle 11g. I am able to maintain data across sessions and logging out invalidates the session which results in a safe termination of the web app.
However, I am unable to fix the problem of the back button. My project is related to banking so the data in the application is considered sensitive. Hence I want to implement the feature that if someone presses the back button then the session should be terminated and redirected to the login page. Further attempts to try that should be a redirect to the login page. I have followed the following threads:
Disable browsers back button if the session is invalidated
Prevent user from seeing previously visited secured page after logout
But the problem I am facing is that it is not working uniformly. Setting the no cache option works sometimes. Sometimes it is showing an error that the page has expired(expected). But then when I click back again and then forward, the page is present as it is(unexpected behaviour). If I enter the url after pressing the back button then it is accessible as well. Again if I am opening two separate sessions then it is working in one and not working in another.
It is becoming a bit confusing and leading to spaghetti code.
Is there any work around regarding this problem?
I found a few other examples that tackle the same problem, but they were in another language(PHP). I am not familiar with php so I was unable to decipher the meaning of the code.
Any help is appreciated.
Regards, Rajorshi Mukherjee.