跨站点共享会话对象 [英] Share session object across Sites

查看:96
本文介绍了跨站点共享会话对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在两个站点之间共享会话对象?在两种情况下(是/否)都可以说明原因....

解决方案

我希望通过"两个站点",您的意思是两个不同的站点,而不是在Web场或Web花园或负载平衡中部署的同一应用程序.

如果您确实的意思是关于两个不同的站点,那么答案是是"!我几天前发现它,它使用HttpModule为每个Asp.net应用程序设置相同的应用程序名称.请参见在应用程序之间共享会话 [ http://msdn.microsoft.com/en-us/library/ms972429.aspx 有关详细信息,请[ ^ ].

Is possible to share a session objects between two sites?In both cases (yes/No) give the reason....

解决方案

I hope by "two sites" you did mean two different sites, not the same application deployed in Web farm or web garden or load balance.

If you really did mean about two different sites, the answer is "Yes"! I found it a few days ago, that uses an HttpModule to set the same application name for each Asp.net application. See Sharing Session Across Applications[^]. Didn''t test it though.

Well, if you did mean about web farm/web garden/load-balanced deployment of same application, you should simply use session mode = "stateserver" or "sqlserver", so that, your session data is not stored in the application memory, rather, stored in out of process or SQL Sever respectively, that can be shared across all instances of the same application. See http://msdn.microsoft.com/en-us/library/ms972429.aspx[^] for details.


这篇关于跨站点共享会话对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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