简体   繁体   English

在登录Cookie到期时重定向父页面

[英]Redirect parent page on Login cookie expiration

I have a problem with server-side auto-redirection to a login page upon cookie timeout. Cookie超时后,服务器端自动重定向到登录页面时出现问题。 Our application uses a wrapper page (called "Application.aspx") which hold all our controls, as well as the rest of our application inside IFrames. 我们的应用程序使用一个包装器页面(称为“ Application.aspx”),其中包含我们所有的控件以及IFrames内的其他应用程序。

My problem occurs when the Login Cookie times out. 登录Cookie超时时发生我的问题。 The user should be looking at a Timeout warning screen in the form of a RadWindow launched when their user-set lock time is reached. 当达到用户设置的锁定时间时,用户应该以RadWindow的形式查看“超时”警告屏幕。 This screen exists until the global Authentication cookie expires. 该屏幕将一直存在,直到全局身份验证cookie过期为止。 However, at that point, any action redirects only the RadWindow to the login, not the full application. 但是,此时,任何操作都只会将RadWindow重定向到登录名,而不是整个应用程序。

I have tried implementing a Response.Redirect("SessionTimeout.aspx,false); line to the globabl.aspx page in the AuthenticationRequest event. However, it appears somewhere along the line an Auto control is redirecting before my SessionTimeout page can execute its pageLoad. 我已经尝试在AuthenticationRequest事件中实现Response.Redirect(“ SessionTimeout.aspx,false);到globabl.aspx页面的行。但是,在自动控件重定向的过程中,我的SessionTimeout页面可以执行它的pageLoad时,它似乎出现在其中。

Sadly, this is for a large company and I cannot share much exact code, but if anyone has found a way around this I would be very happy. 不幸的是,这是针对一家大公司的,我无法共享太多确切的代码,但是如果有人找到解决方法,我将非常高兴。

If anyone else finds this and needs the answer, I ended up creating a new cookie containing the expiry date of the original cookie. 如果其他人找到了这个并且需要答案,我最终创建了一个包含原始cookie到期日期的新cookie。

I then checked if the current datetime was close to the value of the exp with jscript at regular intervals, and when it was within 30 seconds of expiring, redirected the user client-side. 然后,我定期检查当前日期时间是否与jscript的exp值接近,并且在jscript到期后的30秒内,将用户客户端重定向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM