会话没有缓存在群集中? [英] The session don't cached in the Cluster?

查看:63
本文介绍了会话没有缓存在群集中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


大家好,我有一个问题,我无法将会话放入群集中。以下是我的配置:

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来告诉缓存中存储了多少对象。所以当你开始在应用程序和创建新会话时,您会看到对象计数增加
。如果使用旧的会话对象,您将看到requestCount增加到集群。(所有这些值都由上面的powershell命令返回)

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.

即使web-app重启,你也可以收回会话这就是为什么你将web-app的状态存储在它之外的原因。 Appfabric会话提供程序可以帮助您通过在应用程序外部存储会话状态来实现这一点。
You can reclaim the session, even if web-app restart, that is why you store state of your web-app outside it. Appfabric session provider helps you do that by storing session state outside the app.


这篇关于会话没有缓存在群集中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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