简体   繁体   English

会话如何在Azure中工作

[英]How does Session work in Azure

How does Windows Azure handle Session is it InProc session or something else? Windows Azure如何处理Session是InProc会话还是其他?

Also why should one not use Session and instead go for Windows Azure Cache to store transient data? 另外,为什么不使用Session而是使用Windows Azure Cache存储瞬态数据呢?

Session management in Windows Azure depends on how the application is deployed. Windows Azure中的会话管理取决于应用程序的部署方式。 If your application is deployed in Windows Azure Website , then InProc session will work. 如果您的应用程序已部署在Windows Azure Website ,则InProc会话将起作用。 However if your application is deployed as Windows Azure Cloud Service , then InProc session will not work. 但是,如果您的应用程序部署为Windows Azure Cloud Service ,则InProc会话将无法工作。 Reason being the load balancer in front of your cloud service. 原因是成为您的云服务前的负载平衡器。 In case of a cloud service, load balance works in a Round Robin manner and thus InProc session management would not work. 在使用云服务的情况下,负载平衡以Round Robin方式工作,因此InProc会话管理将无法工作。

If you want, you can still use session in your cloud services however you would need to use a different session provider than default InProc provider. 如果需要,您仍可以在云服务中使用会话,但是您需要使用与默认InProc提供程序不同的会话提供程序。 There is a session provider built on top of Windows Azure Cache which can be used (and is actually recommended). 在Windows Azure缓存之上构建了一个会话提供程序,可以使用(实际上建议使用)。 You don't have to make any changes in the code as far as session handling is concerned. 就会话处理而言,您无需在代码中进行任何更改。 Only thing that will change is an entry in your web.config file. 唯一会更改的是web.config文件中的条目。 Please see this link for more details: http://msdn.microsoft.com/en-us/library/windowsazure/gg185668.aspx . 请查看此链接以获取更多详细信息: http : //msdn.microsoft.com/zh-cn/library/windowsazure/gg185668.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM