且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

会话超时消息RoR中使用设计

更新时间:2023-09-12 23:03:40

我认为你需要通过重定向到特定的URL或设置一些查询参数手动显示该信息,例如。

i think that you need to manually show this message, for example by redirecting to a specific url or setting some query parameter.

问题是,你的401请求后,你有一个新的会话,当你重新加载浏览器,下一个请求会打你的应用程序有一个空会话。这就是为什么你得到的未经验证的消息。

the problem is, that after your 401 request you got a new session and when you reload the browser, the next request will hit your application with an empty session. that's why you get the unauthenticated message.