寻找一个黑客以prevent重写应用程序,而无需使用会话变量 [英] Looking for a hack to prevent rewriting an app without using session variables

查看:215
本文介绍了寻找一个黑客以prevent重写应用程序,而无需使用会话变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的公司使用一个应用程序,最初的ColdFusion +接入后来改传统的ASP + MS SQL任务/时间跟踪称为请求系统。它打破按部门,所以有一个信息系统,市场营销,物流等问题出现时(主要是管理人员)使用的是一比在时间,2浏览器窗口打开。要求系统使用会话变量,很多session变量,会话在应​​用程序中被引用2300次。当2的一次,你可以想像这个开放会引发各种从变量异常混淆了。

Our company uses an app that was originally ColdFusion + Access later converted to classic ASP + MS Sql for task/time tracking called the request system. It's broken down by department, so there's one for MIS, marketing, logistics, etc. The problem comes in when (mainly managers) are using more than one at a time, with 2 browser windows open. The request system uses session variables, a lot of session variables, "session" is referenced 2300 times in the application. When 2 are open at once as you can imagine this causes all sorts of anomalies from the variables getting mixed up.

有就是系统中的一个3岁的MIS要求修正这一点,它已经被开发商3的工作,现在轮到我采取了一枪吧。我想知道如果任何人都不得不对这样一个项目工作,如果有某种形式的黑客,试图缓解一些问题。我在想,也许的事情打电话Global.asa中负载杂项。从查询字符串会话变量。问题是,有这种种事情:

There's a 3 year old MIS request in the system to "fix" this and it's been worked on by 3 developers, and now it's my turn to take a shot at it. I was wondering if anyone else has had to work on a project like this, and if there was some sort of hack to try and mitigate some of the problems. I was thinking of maybe calling something in global.asa to load misc. session variables from the querystring. The problem is, there's all sorts of this going on:

If (Session("Application") <> Request("App")) and Request("App") <> "" THEN
  Session("Application") = Request("App")
End If

在功能看包括文件,你有4个参数的函数,这使得6种不同的会话变量的引用。所以,你的想法,这将是痛苦的。

Looking at the functions in include files, you'll have a function with 4 parameters, that makes references to 6 different session variables. So you get the idea, this is going to be painful.

有没有人有做这样的事情在过去的?你发现任何黑客有用吗?

Has anyone had to do anything like this in the past? Any hacks you found useful?

推荐答案

从直接会话重构code远(无所谓)接口:

refactor the code away from the direct Session("whatever") interface:


  1. 创建会话访问的API,并取代所有现有的使用Session它(它可以是一个会话类/对象或只是一个包含文件)

  2. 裂伤传入的名字会话变量的东西,这将使他们根据您的需求(部门或其他)每个域的独特

  3. 测试仔细

然后再重写整个事情在现代的网络语言,和/或另谋高就,他们问你之前执行的其他的奇迹; - )

then rewrite the whole thing later in a modern web language, and/or find another job before they ask you to perform another miracle ;-)

这篇关于寻找一个黑客以prevent重写应用程序,而无需使用会话变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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