Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Windows Azure缓存会话状态值错误_C#_Iis_Azure - Fatal编程技术网

C# Windows Azure缓存会话状态值错误

C# Windows Azure缓存会话状态值错误,c#,iis,azure,C#,Iis,Azure,我有一个使用WindowsAzure缓存服务的基于云的应用程序。以下是我的设置: <!-- Windows Azure Caching session state provider --> <sessionState mode="Custom" customProvider="AFCacheSessionStateProvider"> <providers> <add name="AFCacheSessionStateProvider" ty

我有一个使用WindowsAzure缓存服务的基于云的应用程序。以下是我的设置:

<!-- Windows Azure Caching session state provider -->
<sessionState mode="Custom" customProvider="AFCacheSessionStateProvider">
  <providers>
    <add name="AFCacheSessionStateProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="default" dataCacheClientName="default" applicationName="AFCacheSessionState"/>
  </providers>
</sessionState>


  <dataCacheClients>
<dataCacheClient name="default">
  <!--To use the in-role flavor of Windows Azure Caching, set identifier to be the cache cluster role name -->
  <!--To use the Windows Azure Caching Service, set identifier to be the endpoint of the cache cluster -->
  <autoDiscover isEnabled="true" identifier="xyz.cache.windows.net" />
  <!--<localCache isEnabled="true" sync="TimeoutBased" objectCount="100000" ttlValue="300" />-->
  <!--Use this section to specify security settings for connecting to your cache. This section is not required if your cache is hosted on a role that is a part of your cloud service. -->
  <securityProperties mode="Message" sslEnabled="true">
    <messageSecurity authorizationInfo="xxx" />
  </securityProperties>
</dataCacheClient>

我的会话变量在客户之间混淆了,这是在我添加此会话状态管理之后发生的。下面是正在发生的事情:

  • 客户转到A页。电子邮件是joe@123.com. 称为email的变量保持在会话状态
  • 用户导航到第2页。变量更改为jack@456.com. 任何时候都不能由其他代码指定变量。它保持不变。我的会话状态管理似乎混淆了我的变量

  • 这可能是由不正确的设置或代码引起的吗?我只使用一个具有一个核心的小型虚拟机。我应该使用另一个会话状态管理吗?

    显示配置的会话状态部分和您的代码有助于诊断问题。您添加的会话状态已被注释掉。。。若在实际配置文件中并没有注释掉它,那个么它看起来就正常了。查看请求是否具有正确的cookie(即使用Fiddler)-会话ID可能有问题?我相信Windows Azure缓存服务正在测试中?这可能是一只虫子吗?这个问题偶尔会发生,很难找到。你找到原因了吗?我们遇到了完全相同的问题。