Win2008 ASP.NET 网站上的会话随机清除
我在网上找不到任何关于此的信息,所以我想我会在这里问。你们中是否有人遇到过在 Windows 2008 Server 环境中随机清除会话的问题?这个问题是完全随机的并且非常不可预测。除了注销之外,我没有清除会话的代码,并且不太确定可能导致它的原因(好吧,我有想法......)
我的主人,我已经和他在一起很多年了(并且从未遇到过问题)告诉我 Windows 2003 更擅长管理会话变量,如果我迁移到 2003 Server 环境,我可能会摆脱这个会话清除问题。事实是,我已经使用 URL 重写模块在 IIS 7 上设置并运行,我不想移动或重新配置 URL 重写。技术支持表示我正在运行的应用程序池配置正确。我的会话超时在 Web.config 中设置为 60 分钟,我的主机告诉我我的域的会话超时设置为 60 分钟。
我可以选择使用 Azure AppFabric 缓存来进行会话,但我不想每月额外支付 50 美元——这是一个非常小的低收入站点。我目前正在使用 SQL Azure 数据库,但据我所知,数据库会话在 SQL Azure 上并不理想。
想法?
I couldn't find anything about this online so I thought I'd ask here. Do any of you have issues with sessions just randomly clearing on a Windows 2008 Server environment? This problem is completely random and very unpredictable. I have no code that clears sessions except on logout, and not quite sure what could be causing it (well, I have ideas...)
My host, who I've been with for many years (and never had a problem with) is telling me that Windows 2003 is better at managing session variables and that I will likely be rid of this session clearing issue if I were to move to a 2003 Server environment. Thing is, I'm already set up and running on IIS 7 with the URL Rewrite module and I'd rather not move or reconfigure URL rewriting. Tech support says the App Pool I am running on is configured properly. My session timeout is set to 60 minutes in Web.config and my host tells me that session timeout is set to 60 minutes for my domain.
I could optionally go with an Azure AppFabric Cache for sessions but I'd rather not pay an extra $50 a month--it's a pretty small and low income site. I'm currently using a SQL Azure database but from what I hear, database sessions are not ideal on SQL Azure.
Thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否修改了网站中的任何文件?
对网站的文件夹或文件结构的更改通常会触发应用程序池回收、重置会话。解决方法是使用持久会话存储,例如 SQL Server 会话状态提供程序。
Are you modifying any files in the web site?
Changes to the folder or file structure of the web site often triggers an app pool recycling, resetting sessions. The work-around is to use a durable session store like the SQL Server Session State provider.
最可能的答案是您的应用程序池由于某种原因正在对您进行回收,这将每次都会转储您的进程中会话。直接原因可能有很多,尤其是在共享应用程序池的情况下。查看应用程序池是否被转储的一个简单方法是利用 asp.net 心跳监控,它可以配置为在这些事件发生时向您发送电子邮件。
Most likely answer is your app pool is recycling on you for some reason or another which will dump your in process session every time. Proximate causes can be lots of things, especially if app pools are shared. An easy way to see if your app pool is getting dumped is to take advantage of asp.net heartbeat monitoring, it could be configured to email you when these events occur.