我有一个多页面 Web 应用程序,它使用 iframe 来处理当前页面,顶部有导航器。
问题是,当用户变得空闲并且 session 超时时。该页面继续处于“已记录”状态。 当用户尝试与 iframe 页面(当前页面)交互时,服务器将 iframe 页面重定向到登录页面,并且导航器继续在顶部。
如何将整个页面重定向到登录?
我可以使用 websockets 向服务器发回一条消息,通知 session 超时并重定向到登录吗?
最佳答案
您可以像这样重定向 iframe 的父级:
parent.document.location.href = 'http://...'
关于javascript - Spring session 超时重定向到登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26047036/