I have a RoR site that loads a splash page on the first visit. It's simply a page with information about the service and a form to enter credentials. When the user logs in, the form submits to the same page (document root) but if the user is logged in successfully, the actual site is loaded. My issue is that when the user presses the back button, they're taken back to the log in/splash page. This makes sense because the browser has cached the page, but I'd like it if I could somehow tell that the page is being shown from cache and reload it.
You can see the same functionality on facebook.com:
Set a cookie upon login. Have the home page check for the cookie and redirect accordingly.
发送适当的标头,指示浏览器不要缓存该页面。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.