I want to know how some applications log out users if user refreshes the page manually or click on back button other than clicking on provided menus. I have seen this scenario in many banking applications in India. After thinking, one solution that comes to my mind is for each logged in user i can store current session id and a next session id and pass session id in url. So now if user refreshes the page and if session id is other than the next session id then we can simply log them out. So what i can do is, if the next session id is found in the url then i can set current session id manually.
But this can be hectic from a programming point of view as i will have to set the next session id in each url for the rendered page and i am worried if it is a security threat?
Any thought on this?