是否可以从代码中检测 ASP 会话状态类型?
我正在尝试找出我们的测试环境中的问题。以前它被设置为使用 InProc 会话状态类型,但我已为一个特定的 Web 应用程序添加了 SQLServer 类型。我这样做是因为我们在生产环境中使用 SQLServer 类型,并且我希望我们的测试环境尽可能匹配。
但是,在将其更改为 SQLServer 后,当我尝试在会话中存储不可序列化的数据时,我不会收到任何错误,就像我所期望的那样。它工作得很好,尽管我认为它不应该。在配置方面我是一个相对新手,但从我用谷歌搜索的各种教程中,我认为我涵盖了所有基础知识。
我想知道是否有任何代码片段来验证应用程序正在主动使用哪种会话状态类型。
谢谢
I'm trying to track down a problem on our test environment. Previously it was set to use InProc Session State Type, but I've added in the SQLServer type for one specific Web App. I did this because we use the SQLServer type in our production environment and I want our test env to match as closely as possible.
However, after changing it to SQLServer I do not get any errors when trying to store unserializable data in session like I would expect. It works just fine, even though I would think it shouldn't. I'm a relative newbie when it comes to configuring this, but from the various tutorials I googled, I thought I covered all the bases.
I was wondering if there's any code snippets to verify which session state type an application is actively using.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,通过访问找到它:
还能够查看 ASPState 数据库中的表以查看添加/删除的会话。
显然,这只是我们正在使用的测试代码,我们希望打破它,但它的行为并不像我们预期的那样。
Ok, found it by accessing:
Was also able to look at the tables in the ASPState database to see sessions being added/removed.
Apparently it was just the test code we were using that we expected to break that was not behaving as we expected..