会话超时使用signalr时 [英] Session timeout when using signalr

查看:1137
本文介绍了会话超时使用signalr时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,主要用于监视系统的Web应用程序。它使用signalr从服务器服务器推送的更新刷新显示。网页还具有一些功能的按钮,也使用相同的signalr连接到数据发送到服务器

I have a web app that is used mainly for monitoring a system. It uses signalr to "server-push" updates from the server to refresh the display. The page also has some buttons which also uses the same signalr connection to send data to the server.

问题是signalr使用一个单独的连接,从而会话甚至当它定期发送和接收来自服务器的数据会话超时后过期。

The problem is signalr uses a separate connection so the session expires after the session timeout even when it is regularly sending and receiving data from the server.

这是正确的方式来使用signalr?或者我应该只使用signalr通知更新的客户端,并且在客户端做一个ajax职位检索数据?

Is this the "correct" way to use signalr? Or should I just use signalr to inform the client of updates and have the client do an ajax post to retrieve the data?

有关会话超时问题是什么?我一定要创建一个客户端定时定期做一个保持活跃阿贾克斯后?

What about the session timeout issue? Do I have to create a client-side timer to regularly make a "keep-alive" ajax post?

推荐答案

您应该能够通过发送每5分钟(比你的Cookie超时任何更低)的要求,解决该会话超时问题,为您的Web服务器(只是任何随机页)。实际上,我们要去实现的东西,以改善这SignalR 2.0。

You should be able to workaround the session timeout issue by sending a request every 5 minutes (anything lower than your cookie timeout), to your webserver (just any random page). We're actually going to implement something to improve this in of SignalR 2.0.

这篇关于会话超时使用signalr时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆