问题描述
在之前的工作中,我们有一个经典的 ASP 应用程序,没有人愿意迁移到 ASP.NET.它所做的事情,做得非常好.
In a previous job we had a classic ASP application that no one wanted to migrate to ASP.NET. The things that it did, it did very well.
但是,需要添加一些似乎最适合 ASP.NET 的新功能.做出决定是为了让系统成为 ASP 和 ASP.NET 的奇怪混合体.
However there was some new functionality that needed to be added that just seemed best suited to ASP.NET. The decision was made to allow the system to become a weird hybrid of ASP and ASP.NET.
我们最大的症结是会话管理,我们共同开发了一个解决方案,通过表单变量传递会话值.我已经与其他通过 cookie 处理同样问题的人交谈过.
Our biggest sticking point was session management and we hacked together a solution to pass session values through form variables. I've talked to others that handled this same problem through cookies.
这两种方法看起来都很糟糕(除了非常不安全之外).
Both methods seem a horrible kluge (in addition to being terribly insecure).
有没有更好或更清洁的方法,或者这只是一个糟糕的主意,开始讨论这个话题是没有意义的?
Is there a better or cleaner way or is this just such a bad idea to begin with that discussion on the topic is pointless?
推荐答案
不能将会话数据持久化到服务器端数据存储吗?即 XML 文件、数据库等.然后您可以将哈希(根据一些安全识别会话的标准计算得出)传递给 .NET 页面,该页面可以使用此标识符从数据存储中提取数据并填充您的会话数据.这仍然意味着每次都必须通过代理将请求从 ASP 传递到 ASP.NET,以确保每个应用程序中都有最新的会话数据,但恐怕我不知道实现此目的的替代方法.
Can you not persist session data to a serverside data store? ie XML file, database etc. You could then pass just a hash (calculated based on some criteria that securely identifies the session) to a .NET page which can the pick the data up from the data store using this identifier and populate your session data. It still means having to pass requests from ASP to ASP.NET through a proxy each time to ensure the latest session data is available in each app but I don't know of an alternative way to achieve this I'm afraid.
这篇关于经典 ASP 和 ASP.NET 集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!