I set a src attribute of an iframe as a home page, so after login we redirect the user to the home page.
When the user navigates around it is fine, but the problem comes when the user uses the F5 key on the keyboard as a refresh button.
It refreshes the entire page, which kicks them back to the main page (home page which was set as the src in iframe).
So, I have put the last visited page url in a session variable. But a problem occurs when the last visited page url uses the post method. Then just putting the url in the iframe src does not work as the form has method=post.
this is a common post problem, not related to iframe actually. this is the method i use to prevent this issue:
that way, you won’t have any problems with refreshing the page. you can also store the next page’s url to the session variable at the posted page.