问题描述
大家好,我有一个问题,我无法将会话放入群集中。以下是我的配置: Hi All, I have a question that I can't put the session in the Cluster. Below is my configuration: < sessionState mode =" Custom" customProvider =" AppFabricCacheSessionStoreProvider"> <sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider"> < providers> <! - 指定会话数据的命名缓存 - > <providers> <!-- specify the named cache for session data --> < add name = QUOT; AppFabricCacheSessionStoreProvider"&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; type =" Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider" name="AppFabricCacheSessionStoreProvider" type="Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider" cacheName =" WebSession" cacheName="WebSession" sharedId = QUOT; SharedApp" /> sharedId="SharedApp" /> < / providers> </providers> < / sessionState> </sessionState> 我参加了会议: 会话[" MySession"] = 123456; Session["MySession"]=123456; 每次重新启动应用程序时,都会在缓存中添加一个新的默认区域。 Every time when I restart the application there will be an new default-region added into the Cache. 我想知道如何验证会话已在群集中缓存? I want to know How to verify that the Session has cached in the cluster? 我可以在下次重启时创建会话吗 Can I get the session before create it at the next restart time 因为我已将其缓存到群集中? because I have cached it into the cluster? 你能给我一些建议吗?欣赏。 Could you give me some advices? Appreciate. 谢谢, >大卫 要知道,无论会话是否进入缓存,您都可以使用power-shell 命令 - 让Get-CacheStatistics来告诉缓存中存储了多少对象。所以当你开始在应用程序和创建新会话时,您会看到对象计数增加 To know, whether the session went the to cache or not, you can use power-shell command-let Get-CacheStatistics, that tell how many objects are store in a cache. So when you start the application, and new session is created you would see increase in object count. If old session object is used, you will see increase in requestCount to the cluster. (All these values are returned by above powershell command) 很容易知道会话是新会话还是现有会议。你可以在会话中放一些东西来帮助你识别它。 It is easy to know if session is a new one or existing one. You can put something in session that will help you identify it. 这篇关于会话没有缓存在群集中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
推荐答案
。如果使用旧的会话对象,您将看到requestCount增加到集群。(所有这些值都由上面的powershell命令返回)